in api-generator/main.go [483:543]
func buildFieldOptions(options *descriptor.FieldOptions, output []*ptype.Option) ([]*ptype.Option, error) {
if options == nil {
return output, nil
}
if options.Ctype != nil {
option, err := buildInt32Option("ctype", int32(*options.Ctype))
if err != nil {
return nil, err
}
output = append(output, option)
}
if options.Packed != nil {
option, err := buildBoolOption("packed", *options.Packed)
if err != nil {
return nil, err
}
output = append(output, option)
}
if options.Jstype != nil {
option, err := buildInt32Option("jstype", int32(*options.Jstype))
if err != nil {
return nil, err
}
output = append(output, option)
}
if options.Lazy != nil {
option, err := buildBoolOption("lazy", *options.Lazy)
if err != nil {
return nil, err
}
output = append(output, option)
}
if options.Deprecated != nil {
option, err := buildBoolOption("deprecated", *options.Deprecated)
if err != nil {
return nil, err
}
output = append(output, option)
}
if options.Weak != nil {
option, err := buildBoolOption("weak", *options.Weak)
if err != nil {
return nil, err
}
output = append(output, option)
}
return output, nil
}