Skip to content

Commit 8d9ba31

Browse files
tsuzuJoelSpeed
authored andcommitted
Add comments
1 parent cd7ff1c commit 8d9ba31

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/analysis/commentstart/analyzer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func run(pass *analysis.Pass) (interface{}, error) {
6262
}
6363

6464
if decl.Tok != token.TYPE {
65+
// Returning false here means we won't inspect non-type declarations (e.g. var, const, import).
6566
return false
6667
}
6768

@@ -78,11 +79,14 @@ func run(pass *analysis.Pass) (interface{}, error) {
7879

7980
func checkField(pass *analysis.Pass, field *ast.Field, jsonTags extractjsontags.StructFieldTags) (proceed bool) {
8081
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.
8184
return false
8285
}
8386

8487
tagInfo := jsonTags.FieldTags(field)
8588
if tagInfo.Ignored {
89+
// Returning false here means we won't inspect the children of an ignored field.
8690
return false
8791
}
8892

0 commit comments

Comments
 (0)