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
NodeReferencestring`json:"nodeReference"`// want `naming convention "reference-to-ref": field NodeReference: field names should use 'Ref' instead of 'Reference'`
7
+
NodeReferencestring`json:"nodeReference"`// want `naming convention "reference-to-ref": field TestWithPolicyPreferAbbreviatedReference.NodeReference: field names should use 'Ref' instead of 'Reference'`
8
8
9
-
ConfigReferencestring`json:"configReference"`// want `naming convention "reference-to-ref": field ConfigReference: field names should use 'Ref' instead of 'Reference'`
9
+
ConfigReferencestring`json:"configReference"`// want `naming convention "reference-to-ref": field TestWithPolicyPreferAbbreviatedReference.ConfigReference: field names should use 'Ref' instead of 'Reference'`
10
10
11
11
// Fields ending with References should be flagged
12
-
NodeReferences []string`json:"nodeReferences"`// want `naming convention "reference-to-ref": field NodeReferences: field names should use 'Ref' instead of 'Reference'`
12
+
NodeReferences []string`json:"nodeReferences"`// want `naming convention "reference-to-ref": field TestWithPolicyPreferAbbreviatedReference.NodeReferences: field names should use 'Ref' instead of 'Reference'`
13
13
14
-
ConfigReferences []string`json:"configReferences"`// want `naming convention "reference-to-ref": field ConfigReferences: field names should use 'Ref' instead of 'Reference'`
14
+
ConfigReferences []string`json:"configReferences"`// want `naming convention "reference-to-ref": field TestWithPolicyPreferAbbreviatedReference.ConfigReferences: field names should use 'Ref' instead of 'Reference'`
15
15
16
16
// Fields with Reference at beginning should be flagged
17
-
ReferenceCountint`json:"referenceCount"`// want `naming convention "reference-to-ref": field ReferenceCount: field names should use 'Ref' instead of 'Reference'`
17
+
ReferenceCountint`json:"referenceCount"`// want `naming convention "reference-to-ref": field TestWithPolicyPreferAbbreviatedReference.ReferenceCount: field names should use 'Ref' instead of 'Reference'`
18
18
19
-
ReferenceDatastring`json:"referenceData"`// want `naming convention "reference-to-ref": field ReferenceData: field names should use 'Ref' instead of 'Reference'`
19
+
ReferenceDatastring`json:"referenceData"`// want `naming convention "reference-to-ref": field TestWithPolicyPreferAbbreviatedReference.ReferenceData: field names should use 'Ref' instead of 'Reference'`
20
20
21
21
// Fields with References at beginning should be flagged
22
-
ReferencesCountint`json:"referencesCount"`// want `naming convention "reference-to-ref": field ReferencesCount: field names should use 'Ref' instead of 'Reference'`
22
+
ReferencesCountint`json:"referencesCount"`// want `naming convention "reference-to-ref": field TestWithPolicyPreferAbbreviatedReference.ReferencesCount: field names should use 'Ref' instead of 'Reference'`
23
23
24
-
ReferencesData []string`json:"referencesData"`// want `naming convention "reference-to-ref": field ReferencesData: field names should use 'Ref' instead of 'Reference'`
24
+
ReferencesData []string`json:"referencesData"`// want `naming convention "reference-to-ref": field TestWithPolicyPreferAbbreviatedReference.ReferencesData: field names should use 'Ref' instead of 'Reference'`
25
25
26
26
// Fields with Reference in middle are NOT flagged (only start/end boundaries)
27
27
CrossReferenceIDstring`json:"crossReferenceID"`
@@ -30,7 +30,7 @@ type TestWithPolicyPreferAbbreviatedReference struct {
Referencedbool`json:"referenced"`// want `naming convention "reference-to-ref": field Referenced: field names should use 'Ref' instead of 'Reference'`
33
+
Referencedbool`json:"referenced"`// want `naming convention "reference-to-ref": field TestWithPolicyPreferAbbreviatedReference.Referenced: field names should use 'Ref' instead of 'Reference'`
34
34
35
35
// Fields with Ref/Refs anywhere are ALLOWED in this mode (no diagnostics expected)
Copy file name to clipboardExpand all lines: pkg/analysis/noreferences/testdata/src/a/a.go.golden
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -4,24 +4,24 @@ package a
4
4
// In this mode, Reference/References are flagged at START or END of field names, but Ref/Refs are allowed
5
5
type TestWithPolicyPreferAbbreviatedReference struct {
6
6
// Fields ending with Reference should be flagged
7
-
NodeRef string `json:"nodeRef"` // want `naming convention "reference-to-ref": field NodeReference: field names should use 'Ref' instead of 'Reference'`
7
+
NodeRef string `json:"nodeRef"` // want `naming convention "reference-to-ref": field TestWithPolicyPreferAbbreviatedReference.NodeReference: field names should use 'Ref' instead of 'Reference'`
8
8
9
-
ConfigRef string `json:"configRef"` // want `naming convention "reference-to-ref": field ConfigReference: field names should use 'Ref' instead of 'Reference'`
9
+
ConfigRef string `json:"configRef"` // want `naming convention "reference-to-ref": field TestWithPolicyPreferAbbreviatedReference.ConfigReference: field names should use 'Ref' instead of 'Reference'`
10
10
11
11
// Fields ending with References should be flagged
12
-
NodeRefs []string `json:"nodeRefs"` // want `naming convention "reference-to-ref": field NodeReferences: field names should use 'Ref' instead of 'Reference'`
12
+
NodeRefs []string `json:"nodeRefs"` // want `naming convention "reference-to-ref": field TestWithPolicyPreferAbbreviatedReference.NodeReferences: field names should use 'Ref' instead of 'Reference'`
13
13
14
-
ConfigRefs []string `json:"configRefs"` // want `naming convention "reference-to-ref": field ConfigReferences: field names should use 'Ref' instead of 'Reference'`
14
+
ConfigRefs []string `json:"configRefs"` // want `naming convention "reference-to-ref": field TestWithPolicyPreferAbbreviatedReference.ConfigReferences: field names should use 'Ref' instead of 'Reference'`
15
15
16
16
// Fields with Reference at beginning should be flagged
17
-
RefCount int `json:"refCount"` // want `naming convention "reference-to-ref": field ReferenceCount: field names should use 'Ref' instead of 'Reference'`
17
+
RefCount int `json:"refCount"` // want `naming convention "reference-to-ref": field TestWithPolicyPreferAbbreviatedReference.ReferenceCount: field names should use 'Ref' instead of 'Reference'`
18
18
19
-
RefData string `json:"refData"` // want `naming convention "reference-to-ref": field ReferenceData: field names should use 'Ref' instead of 'Reference'`
19
+
RefData string `json:"refData"` // want `naming convention "reference-to-ref": field TestWithPolicyPreferAbbreviatedReference.ReferenceData: field names should use 'Ref' instead of 'Reference'`
20
20
21
21
// Fields with References at beginning should be flagged
22
-
RefsCount int `json:"refsCount"` // want `naming convention "reference-to-ref": field ReferencesCount: field names should use 'Ref' instead of 'Reference'`
22
+
RefsCount int `json:"refsCount"` // want `naming convention "reference-to-ref": field TestWithPolicyPreferAbbreviatedReference.ReferencesCount: field names should use 'Ref' instead of 'Reference'`
23
23
24
-
RefsData []string `json:"refsData"` // want `naming convention "reference-to-ref": field ReferencesData: field names should use 'Ref' instead of 'Reference'`
24
+
RefsData []string `json:"refsData"` // want `naming convention "reference-to-ref": field TestWithPolicyPreferAbbreviatedReference.ReferencesData: field names should use 'Ref' instead of 'Reference'`
25
25
26
26
// Fields with Reference in middle are NOT flagged (only start/end boundaries)
27
27
CrossReferenceID string `json:"crossReferenceID"`
@@ -30,7 +30,7 @@ type TestWithPolicyPreferAbbreviatedReference struct {
Refd bool `json:"refd"` // want `naming convention "reference-to-ref": field Referenced: field names should use 'Ref' instead of 'Reference'`
33
+
Refd bool `json:"refd"` // want `naming convention "reference-to-ref": field TestWithPolicyPreferAbbreviatedReference.Referenced: field names should use 'Ref' instead of 'Reference'`
34
34
35
35
// Fields with Ref/Refs anywhere are ALLOWED in this mode (no diagnostics expected)
Copy file name to clipboardExpand all lines: pkg/analysis/noreferences/testdata/src/b/b.go
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -4,28 +4,28 @@ package b
4
4
// In this mode, all reference-related words (Reference/References/Ref/Refs) are warned about but not removed
5
5
typeTestWithPolicyNoReferencesstruct {
6
6
// Fields ending with Reference should be flagged
7
-
NodeReferencestring`json:"nodeReference"`// want `naming convention "no-references": field NodeReference: field names should not contain reference-related words`
7
+
NodeReferencestring`json:"nodeReference"`// want `naming convention "no-references": field TestWithPolicyNoReferences.NodeReference: field names should not contain reference-related words`
8
8
9
9
// Fields ending with References should be flagged
10
-
ConfigReferences []string`json:"configReferences"`// want `naming convention "no-references": field ConfigReferences: field names should not contain reference-related words`
10
+
ConfigReferences []string`json:"configReferences"`// want `naming convention "no-references": field TestWithPolicyNoReferences.ConfigReferences: field names should not contain reference-related words`
11
11
12
12
// Fields with Reference at beginning should be flagged
13
-
ReferenceCountint`json:"referenceCount"`// want `naming convention "no-references": field ReferenceCount: field names should not contain reference-related words`
13
+
ReferenceCountint`json:"referenceCount"`// want `naming convention "no-references": field TestWithPolicyNoReferences.ReferenceCount: field names should not contain reference-related words`
14
14
15
15
// Fields with References at beginning should be flagged
16
-
ReferencesData []string`json:"referencesData"`// want `naming convention "no-references": field ReferencesData: field names should not contain reference-related words`
16
+
ReferencesData []string`json:"referencesData"`// want `naming convention "no-references": field TestWithPolicyNoReferences.ReferencesData: field names should not contain reference-related words`
17
17
18
18
// Fields ending with Ref should be flagged
19
-
PodRefstring`json:"podRef"`// want `naming convention "no-references": field PodRef: field names should not contain reference-related words`
19
+
PodRefstring`json:"podRef"`// want `naming convention "no-references": field TestWithPolicyNoReferences.PodRef: field names should not contain reference-related words`
20
20
21
21
// Fields ending with Refs should be flagged
22
-
ContainerRefs []string`json:"containerRefs"`// want `naming convention "no-references": field ContainerRefs: field names should not contain reference-related words`
22
+
ContainerRefs []string`json:"containerRefs"`// want `naming convention "no-references": field TestWithPolicyNoReferences.ContainerRefs: field names should not contain reference-related words`
23
23
24
24
// Fields starting with Ref should be flagged
25
-
RefStatusstring`json:"refStatus"`// want `naming convention "no-references": field RefStatus: field names should not contain reference-related words`
25
+
RefStatusstring`json:"refStatus"`// want `naming convention "no-references": field TestWithPolicyNoReferences.RefStatus: field names should not contain reference-related words`
26
26
27
27
// Fields starting with Refs should be flagged
28
-
RefsTotalint`json:"refsTotal"`// want `naming convention "no-references": field RefsTotal: field names should not contain reference-related words`
28
+
RefsTotalint`json:"refsTotal"`// want `naming convention "no-references": field TestWithPolicyNoReferences.RefsTotal: field names should not contain reference-related words`
Copy file name to clipboardExpand all lines: tests/integration/testdata/default_configurations/volume.go
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -311,7 +311,7 @@ type ImageVolumeSource struct {
311
311
// This field is optional to allow higher level config management to default or override
312
312
// container images in workload controllers like Deployments and StatefulSets.
313
313
// +optional
314
-
Referencestring`json:"reference,omitempty" protobuf:"bytes,1,opt,name=reference"`// want "optionalfields: field Reference should be a pointer." "noreferences: naming convention \"reference-to-ref\": field Reference: field names should use 'Ref' instead of 'Reference'"
314
+
Referencestring`json:"reference,omitempty" protobuf:"bytes,1,opt,name=reference"`// want "optionalfields: field Reference should be a pointer." "noreferences: naming convention \"reference-to-ref\": field ImageVolumeSource.Reference: field names should use 'Ref' instead of 'Reference'"
315
315
316
316
// Policy for pulling OCI objects. Possible values are: // want "commentstart: godoc for field ImageVolumeSource.PullPolicy should start with 'pullPolicy ...'"
317
317
// Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.
0 commit comments