Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Analyzer = &analysis.Analyzer{ Name: "setval", Doc: "find Cmder types that are missing a SetVal method", Run: func(pass *analysis.Pass) (interface{}, error) { cmderTypes := make(map[string]token.Pos) typesWithSetValMethod := make(map[string]bool) for _, file := range pass.Files { for _, decl := range file.Decls { funcName, receiverType := parseFuncDecl(decl, pass.TypesInfo) switch funcName { case "Result": cmderTypes[receiverType] = decl.Pos() case "SetVal": typesWithSetValMethod[receiverType] = true } } } for cmder, pos := range cmderTypes { if !typesWithSetValMethod[cmder] { pass.Reportf(pos, "%s is missing a SetVal method", cmder) } } return nil, nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.