MCPcopy Index your code
hub / github.com/google/go-github / BuildAnalyzers

Method BuildAnalyzers

tools/structfield/structfield.go:82–95  ·  view source on GitHub ↗

BuildAnalyzers builds the analyzers for the StructFieldPlugin.

()

Source from the content-addressed store, hash-verified

80
81// BuildAnalyzers builds the analyzers for the StructFieldPlugin.
82func (f *StructFieldPlugin) BuildAnalyzers() ([]*analysis.Analyzer, error) {
83 return []*analysis.Analyzer{
84 {
85 Name: "structfield",
86 Doc: `Reports mismatches between Go field and JSON or URL tag names and types.
87Note that the JSON or URL tag name is the source-of-truth and the Go field name needs to match it.
88If the "json" tag contains "omitempty", then the Go field must be a reference type.
89If the "url" tag contains "omitempty", then the Go field must be a value type (unless it is a timestamp).`,
90 Run: func(pass *analysis.Pass) (any, error) {
91 return run(pass, f.allowedTagNames, f.allowedTagTypes)
92 },
93 },
94 }, nil
95}
96
97// GetLoadMode returns the load mode for the StructFieldPlugin.
98func (f *StructFieldPlugin) GetLoadMode() string {

Callers 2

analyzeRepoFunction · 0.45
TestRunFunction · 0.45

Calls 1

runFunction · 0.70

Tested by 1

TestRunFunction · 0.36