LEFT | RIGHT |
1 // Copyright 2010 The Go Authors. All rights reserved. | 1 // Copyright 2010 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 /* | 5 /* |
6 | 6 |
7 Vet examines Go source code and reports suspicious constructs, such as Printf | 7 Vet examines Go source code and reports suspicious constructs, such as Printf |
8 calls whose arguments do not align with the format string. Vet uses heuristics | 8 calls whose arguments do not align with the format string. Vet uses heuristics |
9 that do not guarantee all reports are genuine problems, but it can find errors | 9 that do not guarantee all reports are genuine problems, but it can find errors |
10 not caught by the compilers. | 10 not caught by the compilers. |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 Misuse of unsafe Pointers | 144 Misuse of unsafe Pointers |
145 | 145 |
146 Flag: -unsafeptr | 146 Flag: -unsafeptr |
147 | 147 |
148 Likely incorrect uses of unsafe.Pointer to convert integers to pointers. | 148 Likely incorrect uses of unsafe.Pointer to convert integers to pointers. |
149 A conversion from uintptr to unsafe.Pointer is invalid if it implies that | 149 A conversion from uintptr to unsafe.Pointer is invalid if it implies that |
150 there is a uintptr-typed word in memory that holds a pointer value, | 150 there is a uintptr-typed word in memory that holds a pointer value, |
151 because that word will be invisible to stack copying and to the garbage | 151 because that word will be invisible to stack copying and to the garbage |
152 collector. | 152 collector. |
153 | 153 |
154 Suspicious shifts | 154 Shifts |
155 | 155 |
156 Flag: -shift | 156 Flag: -shift |
157 | 157 |
158 Shifts equal to or longer than the variable's length. | 158 Shifts equal to or longer than the variable's length. |
159 | 159 |
160 Other flags | 160 Other flags |
161 | 161 |
162 These flags configure the behavior of vet: | 162 These flags configure the behavior of vet: |
163 | 163 |
164 -all (default true) | 164 -all (default true) |
165 Check everything; disabled if any explicit check is requested. | 165 Check everything; disabled if any explicit check is requested. |
166 -v | 166 -v |
167 Verbose mode | 167 Verbose mode |
168 -printfuncs | 168 -printfuncs |
169 A comma-separated list of print-like functions to supplement | 169 A comma-separated list of print-like functions to supplement |
170 the standard list. Each entry is in the form Name:N where N | 170 the standard list. Each entry is in the form Name:N where N |
171 is the zero-based argument position of the first argument | 171 is the zero-based argument position of the first argument |
172 involved in the print: either the format or the first print | 172 involved in the print: either the format or the first print |
173 argument for non-formatted prints. For example, | 173 argument for non-formatted prints. For example, |
174 if you have Warn and Warnf functions that take an | 174 if you have Warn and Warnf functions that take an |
175 io.Writer as their first argument, like Fprintf, | 175 io.Writer as their first argument, like Fprintf, |
176 -printfuncs=Warn:1,Warnf:1 | 176 -printfuncs=Warn:1,Warnf:1 |
177 -shadowstrict | 177 -shadowstrict |
178 Whether to be strict about shadowing; can be noisy. | 178 Whether to be strict about shadowing; can be noisy. |
179 -test | 179 -test |
180 For testing only: sets -all and -shadow. | 180 For testing only: sets -all and -shadow. |
181 */ | 181 */ |
182 package main | 182 package main |
LEFT | RIGHT |