Don't make Id fields pointers as they are immutable

pull/27/head
Jeff Mitchell 6 years ago
parent 416688448c
commit 1f0748a8c3

@ -116,7 +116,11 @@ func parsePBs() {
var selectorExpr *ast.SelectorExpr
switch typ := field.Type.(type) {
case *ast.Ident:
typ.Name = "*" + typ.Name
// Id values are immutable and should always exist, so
// don't make it a pointer
if field.Names[0].Name != "Id" {
typ.Name = "*" + typ.Name
}
goto TAGMODIFY
case *ast.ArrayType:
goto TAGMODIFY

Loading…
Cancel
Save