File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ func run(pass *analysis.Pass) (interface{}, error) {
62
62
}
63
63
64
64
if decl .Tok != token .TYPE {
65
+ // Returning false here means we won't inspect non-type declarations (e.g. var, const, import).
65
66
return false
66
67
}
67
68
@@ -78,11 +79,14 @@ func run(pass *analysis.Pass) (interface{}, error) {
78
79
79
80
func checkField (pass * analysis.Pass , field * ast.Field , jsonTags extractjsontags.StructFieldTags ) (proceed bool ) {
80
81
if field == nil || len (field .Names ) == 0 {
82
+ // Returning false here means we don't inspect inline fields.
83
+ // Types of inline fields will be inspected on its declaration.
81
84
return false
82
85
}
83
86
84
87
tagInfo := jsonTags .FieldTags (field )
85
88
if tagInfo .Ignored {
89
+ // Returning false here means we won't inspect the children of an ignored field.
86
90
return false
87
91
}
88
92
You can’t perform that action at this time.
0 commit comments