Skip to content

Commit 2ffc60e

Browse files
committed
Add a test for json:"-," field
1 parent 3275666 commit 2ffc60e

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

Diff for: pkg/analysis/commentstart/testdata/src/a/a.go

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ type CommentStartTestStruct struct {
66
InlineJSONTag string `json:",inline"`
77
NoComment string `json:"noComment"` // want "field NoComment is missing godoc comment"
88
Ignored string `json:"-"`
9+
Hyphen string `json:"-,"` // want "field Hyphen is missing godoc comment"
910

1011
// IncorrectStartComment is a field with an incorrect start to the comment. // want "godoc for field IncorrectStartComment should start with 'incorrectStartComment ...'"
1112
IncorrectStartComment string `json:"incorrectStartComment"`

Diff for: pkg/analysis/commentstart/testdata/src/a/a.go.golden

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ type CommentStartTestStruct struct {
66
InlineJSONTag string `json:",inline"`
77
NoComment string `json:"noComment"` // want "field NoComment is missing godoc comment"
88
Ignored string `json:"-"`
9+
Hyphen string `json:"-,"` // want "field Hyphen is missing godoc comment"
910

1011
// incorrectStartComment is a field with an incorrect start to the comment. // want "godoc for field IncorrectStartComment should start with 'incorrectStartComment ...'"
1112
IncorrectStartComment string `json:"incorrectStartComment"`

0 commit comments

Comments
 (0)