Don't make Id fields pointers as they are immutable

This commit is contained in:
Jeff Mitchell committed 2020-05-05 14:02:46 -04:00
1 parent 416688448c
commit 1f0748a8c3
1 file changed
+5 -1
+5 -1
View File
@@ -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