You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
message:=fmt.Sprintf("%s is an array of structs, but the struct has no required fields. At least one field should be marked as required to prevent ambiguous YAML configurations", prefix)
message:=fmt.Sprintf("%s is an array of structs, but the struct has no required fields. At least one field should be marked as required to prevent ambiguous YAML configurations", qualifiedFieldName)
Copy file name to clipboardExpand all lines: pkg/analysis/commentstart/testdata/src/a/a.go
+16-16Lines changed: 16 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,11 @@ type CommentStartTestStruct struct {
6
6
NoJSONTagstring
7
7
EmptyJSONTagstring`json:""`
8
8
InlineJSONTagstring`json:",inline"`
9
-
NoCommentstring`json:"noComment"`// want "field NoComment is missing godoc comment"
9
+
NoCommentstring`json:"noComment"`// want "field CommentStartTestStruct.NoComment is missing godoc comment"
10
10
Ignoredstring`json:"-"`
11
-
Hyphenstring`json:"-,"`// want "field Hyphen is missing godoc comment"
11
+
Hyphenstring`json:"-,"`// want "field CommentStartTestStruct.Hyphen is missing godoc comment"
12
12
13
-
AnonymousStructstruct { // want "field AnonymousStruct is missing godoc comment"
13
+
AnonymousStructstruct { // want "field CommentStartTestStruct.AnonymousStruct is missing godoc comment"
14
14
NoCommentstring`json:"noComment"`// want "field NoComment is missing godoc comment"
15
15
} `json:"anonymousStruct"`
16
16
@@ -24,18 +24,18 @@ type CommentStartTestStruct struct {
24
24
25
25
StructForInlineField`json:",inline"`
26
26
27
-
A`json:"a"`// want "field A is missing godoc comment"
27
+
A`json:"a"`// want "field CommentStartTestStruct.A is missing godoc comment"
28
28
29
-
PkgA pkg.A`json:"pkgA"`// want "field PkgA is missing godoc comment"
29
+
PkgA pkg.A`json:"pkgA"`// want "field CommentStartTestStruct.PkgA is missing godoc comment"
30
30
31
-
pkg.Embedded`json:"embedded"`// want "field pkg.Embedded is missing godoc comment"
31
+
pkg.Embedded`json:"embedded"`// want "field CommentStartTestStruct.pkg.Embedded is missing godoc comment"
32
32
33
-
*pkg.EmbeddedPointer`json:"embeddedPointer"`// want "field \\*pkg.EmbeddedPointer is missing godoc comment"
33
+
*pkg.EmbeddedPointer`json:"embeddedPointer"`// want "field CommentStartTestStruct.\\*pkg.EmbeddedPointer is missing godoc comment"
34
34
35
-
// IncorrectStartComment is a field with an incorrect start to the comment. // want "godoc for field IncorrectStartComment should start with 'incorrectStartComment ...'"
35
+
// IncorrectStartComment is a field with an incorrect start to the comment. // want "godoc for field CommentStartTestStruct.IncorrectStartComment should start with 'incorrectStartComment ...'"
// IncorrectStartOptionalComment is a field with an incorrect start to the comment. // want "godoc for field IncorrectStartOptionalComment should start with 'incorrectStartOptionalComment ...'"
38
+
// IncorrectStartOptionalComment is a field with an incorrect start to the comment. // want "godoc for field CommentStartTestStruct.IncorrectStartOptionalComment should start with 'incorrectStartOptionalComment ...'"
// IncorrectMultiLineComment is a field with an incorrect start to the comment. // want "godoc for field IncorrectMultiLineComment should start with 'incorrectMultiLineComment ...'"
47
+
// IncorrectMultiLineComment is a field with an incorrect start to the comment. // want "godoc for field CommentStartTestStruct.IncorrectMultiLineComment should start with 'incorrectMultiLineComment ...'"
48
48
// Except this time there are multiple lines to the comment.
// This comment just isn't correct at all, doesn't even start with anything resembling the field names. // want "godoc for field IncorrectComment should start with 'incorrectComment ...'"
55
+
// This comment just isn't correct at all, doesn't even start with anything resembling the field names. // want "godoc for field CommentStartTestStruct.IncorrectComment should start with 'incorrectComment ...'"
56
56
IncorrectCommentstring`json:"incorrectComment"`
57
57
}
58
58
59
59
// DoNothing is used to check that the analyser doesn't report on methods.
60
60
func (CommentStartTestStruct) DoNothing() {}
61
61
62
62
typeStructForInlineFieldstruct {
63
-
NoCommentstring`json:"noComment"`// want "field NoComment is missing godoc comment"
63
+
NoCommentstring`json:"noComment"`// want "field StructForInlineField.NoComment is missing godoc comment"
64
64
}
65
65
66
66
typeAstruct {
67
-
NoCommentstring`json:"noComment"`// want "field NoComment is missing godoc comment"
67
+
NoCommentstring`json:"noComment"`// want "field A.NoComment is missing godoc comment"
68
68
}
69
69
70
70
typeunexportedStructstruct {
71
-
NoCommentstring`json:"noComment"`// want "field NoComment is missing godoc comment"
71
+
NoCommentstring`json:"noComment"`// want "field unexportedStruct.NoComment is missing godoc comment"
72
72
}
73
73
74
74
type (
75
75
MultipleTypeDeclaration1struct {
76
-
NoCommentstring`json:"noComment"`// want "field NoComment is missing godoc comment"
76
+
NoCommentstring`json:"noComment"`// want "field MultipleTypeDeclaration1.NoComment is missing godoc comment"
77
77
}
78
78
MultipleTypeDeclaration2struct {
79
-
NoCommentstring`json:"noComment"`// want "field NoComment is missing godoc comment"
79
+
NoCommentstring`json:"noComment"`// want "field MultipleTypeDeclaration2.NoComment is missing godoc comment"
pkg.Embedded `json:"embedded"` // want "field pkg.Embedded is missing godoc comment"
31
+
pkg.Embedded `json:"embedded"` // want "field CommentStartTestStruct.pkg.Embedded is missing godoc comment"
32
32
33
-
*pkg.EmbeddedPointer `json:"embeddedPointer"` // want "field \\*pkg.EmbeddedPointer is missing godoc comment"
33
+
*pkg.EmbeddedPointer `json:"embeddedPointer"` // want "field CommentStartTestStruct.\\*pkg.EmbeddedPointer is missing godoc comment"
34
34
35
-
// incorrectStartComment is a field with an incorrect start to the comment. // want "godoc for field IncorrectStartComment should start with 'incorrectStartComment ...'"
35
+
// incorrectStartComment is a field with an incorrect start to the comment. // want "godoc for field CommentStartTestStruct.IncorrectStartComment should start with 'incorrectStartComment ...'"
// incorrectStartOptionalComment is a field with an incorrect start to the comment. // want "godoc for field IncorrectStartOptionalComment should start with 'incorrectStartOptionalComment ...'"
38
+
// incorrectStartOptionalComment is a field with an incorrect start to the comment. // want "godoc for field CommentStartTestStruct.IncorrectStartOptionalComment should start with 'incorrectStartOptionalComment ...'"
// incorrectMultiLineComment is a field with an incorrect start to the comment. // want "godoc for field IncorrectMultiLineComment should start with 'incorrectMultiLineComment ...'"
47
+
// incorrectMultiLineComment is a field with an incorrect start to the comment. // want "godoc for field CommentStartTestStruct.IncorrectMultiLineComment should start with 'incorrectMultiLineComment ...'"
48
48
// Except this time there are multiple lines to the comment.
// This comment just isn't correct at all, doesn't even start with anything resembling the field names. // want "godoc for field IncorrectComment should start with 'incorrectComment ...'"
55
+
// This comment just isn't correct at all, doesn't even start with anything resembling the field names. // want "godoc for field CommentStartTestStruct.IncorrectComment should start with 'incorrectComment ...'"
56
56
IncorrectComment string `json:"incorrectComment"`
57
57
}
58
58
59
59
// DoNothing is used to check that the analyser doesn't report on methods.
0 commit comments