"github.com/sirupsen/logrus"
)
-func init() {
- //RegisterPlugin("encoding", GenerateEncoding)
-}
-
func genMessageSize(g *GenFile, name string, fields []*Field) {
g.P("func (m *", name, ") Size() (size int) {")
g.P("if m == nil { return 0 }")
g.P("buf.EncodeBytes(", name, "[:], ", length, ")")
}
return
- case I8, I16, U16, I32, U32, I64, U64, F64:
+ case I8, I16, U16, I32, U32, I64, U64, F64, BOOL:
gotype := BaseTypesGo[typ]
if length != 0 {
g.P("for i := 0; i < ", length, "; i++ {")
}
if isArray {
switch typ {
- case I8, U8, I16, U16, I32, U32, I64, U64, F64:
+ case I8, U8, I16, U16, I32, U32, I64, U64, F64, BOOL:
g.P("}")
}
}
g.P("copy(", name, "[:], buf.DecodeBytes(", size, "))")
}
return
- case I8, I16, U16, I32, U32, I64, U64, F64:
+ case I8, I16, U16, I32, U32, I64, U64, F64, BOOL:
if alloc {
g.P(name, " = make([]", orig, ", ", size, ")")
}
}
if isArray {
switch typ {
- case I8, U8, I16, U16, I32, U32, I64, U64, F64:
+ case I8, U8, I16, U16, I32, U32, I64, U64, F64, BOOL:
g.P("}")
}
}