Code inspect - clean ups (#8445)

This commit is contained in:
terence tsao
2021-02-12 15:04:45 -08:00
committed by GitHub
parent e2c5ae53e7
commit 068f758f49
17 changed files with 36 additions and 36 deletions

View File

@@ -23,7 +23,7 @@ var Analyzer = &analysis.Analyzer{
}
func run(pass *analysis.Pass) (interface{}, error) {
inspect, ok := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector)
inspection, ok := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector)
if !ok {
return nil, errors.New("analyzer is not type *inspector.Inspector")
}
@@ -32,7 +32,7 @@ func run(pass *analysis.Pass) (interface{}, error) {
(*ast.StructType)(nil),
}
inspect.Preorder(nodeFilter, func(node ast.Node) {
inspection.Preorder(nodeFilter, func(node ast.Node) {
if s, ok := node.(*ast.StructType); ok {
if err := malign(node.Pos(), pass.TypesInfo.Types[s].Type.(*types.Struct)); err != nil {
pass.Reportf(node.Pos(), err.Error())