forked from go-critic/go-critic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
positive_tests.go
183 lines (145 loc) · 4.18 KB
/
positive_tests.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
package checker_test
/*! use `Deprecated: ` (note the casing) instead of `deprecated: ` */
// deprecated: part of the old API; use API v2
func LowerCasePrefix() {}
/*! use `Deprecated: ` (note the casing) instead of `DEPRECATED: ` */
// DEPRECATED: part of the old API; use API v2
func UpperCasePrefix() {}
/*! use `:` instead of `,` in `Deprecated, ` */
// Deprecated, use XYZ instead.
func CommaInsteadOfColon() {}
// BadFormat1 is an example.
/*! the proper format is `Deprecated: <text>` */
// This function is deprecated, use XYZ instead.
func BadFormat1() {}
// BadFormat2 is an example, too.
//
/*! the proper format is `Deprecated: <text>` */
// this function is deprecated, use XYZ instead.
func BadFormat2() {}
// BadFormat3 is an example, too.
//
/*! the proper format is `Deprecated: <text>` */
// This type is deprecated, use XYZ instead.
type BadFormat3 int
/*! the proper format is `Deprecated: <text>` */
// this type is deprecated, use XYZ instead.
type badFormat4 int
/*! the proper format is `Deprecated: <text>` */
// deprecated! use something-else/a.f() instead
const BadFormat5 int = 10
//
//
/*! the proper format is `Deprecated: <text>` */
// deprecated use XYZ instead
const BadFormat6 int = 10
//
/*! the proper format is `Deprecated: <text>` */
// DEPRECATED. use XYZ instead
const BadFormat7 int = 10
//
// (This is why we're using case-insensitive patterns.)
//
/*! the proper format is `Deprecated: <text>` */
// Deprecated! USE ANYTHING INSTEAD!
const BadFormat8 = 10
//
// (This is why we're using case-insensitive patterns.)
//
/*! the proper format is `Deprecated: <text>` */
// [[deprecated]]
const BadFormat9 = 10
// BadFormat10 is an example, too.
//
/*! the proper format is `Deprecated: <text>` */
// ThIs TyPe iS DepRecateD, use foo instead.
type BadFormat10 int
/*! use `Deprecated: ` (note the casing) instead of `DEPRECATED: ` */
// DEPRECATED: part of the old API; use API v2
func BadFormat11() {}
type badNestedDoc struct {
/*! use `Deprecated: ` (note the casing) instead of `deprecated: ` */
// deprecated: ha-ha
foo struct {
/*! use `:` instead of `,` in `Deprecated, ` */
// Deprecated, first deprecated field
field int
/*! use `Deprecated: ` (note the casing) instead of `deprecated: ` */
// deprecated: another one
bar struct {
/*! use `Deprecated: ` (note the casing) instead of `deprecated: ` */
// deprecated: deprecated field
field int
}
}
}
/*! typo in `Dprecated`; should be `Deprecated` */
// Dprecated: ...
func withTypo1() {}
var (
/*! typo in `Dprecated`; should be `Deprecated` */
// Dprecated: ...
_ = 0
/*! typo in `Derecated`; should be `Deprecated` */
// Derecated: ...
_ = 0
/*! typo in `Depecated`; should be `Deprecated` */
// Depecated: ...
_ = 0
/*! typo in `Deprcated`; should be `Deprecated` */
// Deprcated: ...
_ = 0
/*! typo in `Depreated`; should be `Deprecated` */
// Depreated: ...
_ = 0
/*! typo in `Deprected`; should be `Deprecated` */
// Deprected: ...
_ = 0
/*! typo in `Deprecaed`; should be `Deprecated` */
// Deprecaed: ...
_ = 0
/*! typo in `Deprecatd`; should be `Deprecated` */
// Deprecatd: ...
_ = 0
/*! typo in `Deprecate`; should be `Deprecated` */
// Deprecate: ...
_ = 0
/*! typo in `DeprEcate`; should be `Deprecated` */
// DeprEcate: ...
_ = 0
/*! typo in `deprecate`; should be `Deprecated` */
// deprecate: ...
_ = 0
/*! typo in `dePrecate`; should be `Deprecated` */
// dePrecate: ...
_ = 0
/*! typo in `Depekated`; should be `Deprecated` */
// Depekated: ...
_ = 0
/*! typo in `DepeKated`; should be `Deprecated` */
// DepeKated: ...
_ = 0
/*! typo in `Derpecate`; should be `Deprecated` */
// Derpecate: ...
_ = 0
/*! typo in `DERPecate`; should be `Deprecated` */
// DERPecate: ...
_ = 0
/*! typo in `Depreacted`; should be `Deprecated` */
// Depreacted: ...
_ = 0
)
/*! the proper format is `Deprecated: <text>` */
// NOTE: Deprecated. Use bar instead.
func foo1() {
}
/*! the proper format is `Deprecated: <text>` */
// NOTE: Deprecated.
func foo2() {
}
/*! the proper format is `Deprecated: <text>` */
// deprecated in 1.8: use bar instead.
type foo3 string
/*! the proper format is `Deprecated: <text>` */
// deprecated in 1.11: use f instead.
type foo4 string