fix: linter

This commit is contained in:
2026-03-25 13:20:38 +03:00
parent 9bda871e7c
commit 433afeaaa3
2 changed files with 8 additions and 23 deletions
+1 -16
View File
@@ -701,21 +701,6 @@ func luaDefaultValue(f parser.Field, enumNames map[string]struct{}) string {
return "nil" return "nil"
} }
func luaTypeName(f parser.Field, enumNames map[string]struct{}) string {
switch f.Kind {
case parser.KindPrimitive:
if luaIsEnumType(f, enumNames) {
return "number"
}
return "number"
case parser.KindNested:
return f.TypeName
case parser.KindFixedArray, parser.KindSlice:
return "table"
}
return "any"
}
func luaSerializeValueExpr(access string, f parser.Field, enumNames map[string]struct{}) string { func luaSerializeValueExpr(access string, f parser.Field, enumNames map[string]struct{}) string {
if !luaIsEnumType(f, enumNames) { if !luaIsEnumType(f, enumNames) {
return access return access
@@ -765,7 +750,7 @@ func checkFieldLuaSupport(msgName string, f parser.Field) error {
switch f.Kind { switch f.Kind {
case parser.KindPrimitive: case parser.KindPrimitive:
if f.Primitive == parser.KindInt64 || f.Primitive == parser.KindUint64 { if f.Primitive == parser.KindInt64 || f.Primitive == parser.KindUint64 {
return fmt.Errorf("Lua target does not support int64/uint64: field %s in message %s (LuaJIT/Defold uses double-precision floats which can only safely represent integers up to 2^53)", f.Name, msgName) return fmt.Errorf("lua target does not support int64/uint64: field %s in message %s (LuaJIT/Defold uses double-precision floats which can only safely represent integers up to 2^53)", f.Name, msgName)
} }
case parser.KindFixedArray, parser.KindSlice: case parser.KindFixedArray, parser.KindSlice:
if f.Elem != nil { if f.Elem != nil {
+4 -4
View File
@@ -19,10 +19,10 @@ type MoveMessage struct {
Velocity [3]float32 Velocity [3]float32
Waypoints []Vector3 Waypoints []Vector3
PlayerID uint32 PlayerID uint32
Active bool Active bool
Visible bool Visible bool
Ghost bool Ghost bool
Name string Name string
} }
type SpawnMessage struct { type SpawnMessage struct {