MCPcopy Create free account
hub / github.com/google/go-github / checkGoFieldName

Function checkGoFieldName

tools/structfield/structfield.go:238–249  ·  view source on GitHub ↗
(structName, goFieldName, tagType, tagName string, tokenPos token.Pos, pass *analysis.Pass, allowedNames map[string]bool)

Source from the content-addressed store, hash-verified

236}
237
238func 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
251func 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] {

Callers 1

processTagFunction · 0.85

Calls 1

tagNameToPascalFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…