|
1 | 1 | // Package golint comment
|
2 | 2 | package golint
|
3 | 3 |
|
| 4 | +import "net/http" |
| 5 | + |
4 | 6 | type (
|
5 | 7 | // O is a shortcut (alias) for map[string]interface{}, e.g. a JSON object.
|
6 | 8 | O = map[string]interface{}
|
@@ -33,3 +35,21 @@ func Toto2() {}
|
33 | 35 |
|
34 | 36 | /*SecondLetter something */
|
35 | 37 | const SecondLetter = "B"
|
| 38 | + |
| 39 | +// Tests for common method names |
| 40 | +//// Should NOT fail for methods |
| 41 | +func (_) Error() string { return "" } |
| 42 | +func (_) String() string { return "" } |
| 43 | +func (_) ServeHTTP(w http.ResponseWriter, r *http.Request) {} |
| 44 | +func (_) Read(p []byte) (n int, err error) { return 0, nil } |
| 45 | +func (_) Write(p []byte) (n int, err error) { return 0, nil } |
| 46 | +func (_) Unwrap(err error) error { return nil } |
| 47 | + |
| 48 | +//// Should fail for functions |
| 49 | + |
| 50 | +func Error() string { return "" } // MATCH /exported function Error should have comment or be unexported/ |
| 51 | +func String() string { return "" } // MATCH /exported function String should have comment or be unexported/ |
| 52 | +func ServeHTTP(w http.ResponseWriter, r *http.Request) {} // MATCH /exported function ServeHTTP should have comment or be unexported/ |
| 53 | +func Read(p []byte) (n int, err error) { return 0, nil } // MATCH /exported function Read should have comment or be unexported/ |
| 54 | +func Write(p []byte) (n int, err error) { return 0, nil } // MATCH /exported function Write should have comment or be unexported/ |
| 55 | +func Unwrap(err error) error { return nil } // MATCH /exported function Unwrap should have comment or be unexported/ |
0 commit comments