(structName, goFieldName, tagType, tagName string, tokenPos token.Pos, pass *analysis.Pass, allowedNames map[string]bool)
| 236 | } |
| 237 | |
| 238 | func checkGoFieldName(structName, goFieldName, tagType, tagName string, tokenPos token.Pos, pass *analysis.Pass, allowedNames map[string]bool) { |
| 239 | fullName := structName + "." + goFieldName |
| 240 | if allowedNames[fullName] { |
| 241 | return |
| 242 | } |
| 243 | |
| 244 | want, alternate := tagNameToPascal(tagName) |
| 245 | if goFieldName != want && goFieldName != alternate { |
| 246 | const msg = "change Go field name %q to %q for %v tag %q in struct %q" |
| 247 | pass.Reportf(tokenPos, msg, goFieldName, want, tagType, tagName, structName) |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | func checkGoFieldType(structName, goFieldName, tagType string, field *ast.Field, tokenPos token.Pos, pass *analysis.Pass, allowedTypes map[string]bool, omitempty, omitzero bool) { |
| 252 | if allowedTypes[structName+"."+goFieldName] { |
no test coverage detected
searching dependent graphs…