Don't make Id fields pointers as they are immutable
This commit is contained in:
1 parent
416688448c
commit
1f0748a8c3
1 file changed
+4
@@ -116,7 +116,11 @@ func parsePBs() {
|
||||
var selectorExpr *ast.SelectorExpr
|
||||
switch typ := field.Type.(type) {
|
||||
case *ast.Ident:
|
||||
// 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
|
||||
|
||||
Reference in new issue
Block a user