-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmessages.txt
172 lines (88 loc) · 3.4 KB
/
messages.txt
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
Assembly declarations
Flag: -asmdecl
Mismatches between assembly files and Go function declarations.
Useless assignments
Flag: -assign
Check for useless assignments.
Common mistaken usages of the sync/atomic package
Flag: -atomic
Common mistaken usages of the sync/atomic package.
Mistakes involving boolean operators
Flag: -bool
Mistakes involving boolean operators.
Badly formed or misplaced +build tags
Flag: -buildtags
Badly formed or misplaced +build tags.
Invalid uses of cgo
Flag: -cgocall
Detect some violations of the cgo pointer passing rules.
Composite literals use field-keyed elements
Flag: -composites
Composite struct literals that do not use the field-keyed syntax.
Locks are passed by value
Flag: -copylocks
Locks that are erroneously passed by value.
HTTP responses used incorrectly
Flag: -httpresponse
Mistakes deferring a function call on an HTTP response before checking whether the error returned with the response was nil.
Failure to call the cancelation function returned by context.WithCancel.
Flag: -lostcancel
The cancelation function returned by context.WithCancel, WithTimeout, and
WithDeadline must be called or the new context will remain live until its
parent context is cancelled. (The background context is never cancelled.)
Non-standard signatures for methods with familiar names
Flag: -methods
Non-standard signatures for methods with familiar names, including:
```
Format GobEncode GobDecode MarshalJSON MarshalXML
Peek ReadByte ReadFrom ReadRune Scan Seek
UnmarshalJSON UnreadByte UnreadRune WriteByte
WriteTo
```
Nil function comparison
Flag: -nilfunc
Comparisons between functions and nil.
Suspicious calls to functions in the Printf family
Flag: -printf
Suspicious calls to functions in the Printf family, including any functions
with these names, disregarding case:
```
Print Printf Println
Fprint Fprintf Fprintln
Sprint Sprintf Sprintln
Error Errorf
Fatal Fatalf
Log Logf
Panic Panicf Panicln
```
Incorrect uses of range loop variables in closures
Flag: -rangeloops
Incorrect uses of range loop variables in closures.
Variables that may have been unintentionally shadowed
Flag: -shadow
Variables that may have been unintentionally shadowed.
Useless shifts
Flag: -shift
Shifts equal to or longer than the variable's length.
Struct field tags do not have canonical format
Flag: -structtags
Struct tags that do not follow the format understood by `reflect.StructTag.Get`. Well-known encoding struct tags (json, xml) used with unexported fields.
Common mistaken usages of tests/documentation
Flag: -tests
Mistakes involving tests including functions with incorrect names or
signatures and example tests that document identifiers not in the package.
Unreachable code
Flag: -unreachable
Unreachable code.
Misuse of unsafe Pointers
Flag: -unsafeptr
Likely incorrect uses of unsafe.Pointer to convert integers to pointers. A
conversion from uintptr to unsafe.Pointer is invalid if it implies that
there is a uintptr-typed word in memory that holds a pointer value, because
that word will be invisible to stack copying and to the garbage collector.
Unused result of certain function calls
Flag: -unusedresult
Calls to well-known functions and methods that return a value that is
discarded. By default, this includes functions like fmt.Errorf and
fmt.Sprintf and methods like String and Error. The flags -unusedfuncs and
-unusedstringmethods control the set.