Skip to content

Commit 87b146c

Browse files
authored
refactor: gofmt testdata (#1379)
1 parent e8ed573 commit 87b146c

20 files changed

+54
-62
lines changed

‎testdata/disable_annotations2.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ func foo11() {
1212
var invalid_name2 = 1 //revive:disable-line:var-naming I'm an Eiffel programmer thus I like underscores
1313
}
1414

15-
1615
func foo2() {
1716
// revive:disable-next-line:var-naming
1817
//revive:disable

‎testdata/disable_annotations3.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Package fix_tures is a testing package
22
// tests for issue #540
3+
//
34
//revive:disable-next-line:var-naming
45
package fix_tures
56

‎testdata/duplicated_imports.go‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package fixtures
22

3-
import(
3+
import (
44
"crypto/md5"
5-
"strings"
6-
_ "crypto/md5" // MATCH /Package "crypto/md5" already imported/
7-
str "strings" // MATCH /Package "strings" already imported/
5+
_ "crypto/md5" // MATCH /Package "crypto/md5" already imported/
6+
"strings"
7+
str "strings" // MATCH /Package "strings" already imported/
88
)

‎testdata/exported_issue_1002.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ type Some interface {
1010
// Correct - should do all correct
1111
Correct()
1212
// MATCH /comment on exported interface method Some.SemiCorrect should be of the form "SemiCorrect ..."/
13-
SemiCorrect()
13+
SemiCorrect()
1414
NonCorrect() // MATCH /public interface method Some.NonCorrect should be commented/
1515
}
1616

1717
// Other - just to check names compatibility
18-
type Other interface {}
18+
type Other interface{}
1919

2020
// for private interfaces it doesn't check docs anyway
2121

2222
type somePrivate interface {
2323
AllGood()
24-
}
24+
}

‎testdata/exported_issue_1045.go‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
// Package golint comment
22
package golint
33

4-
54
// path separator defined by os.Separator.
65
const FilePath = "xyz"
76

8-
97
// Rewrite string to remove non-standard path characters
108
func UnicodeSanitize(s string) string {}
119

12-
1310
// Tags returns a slice of tags. The order is the original tag order unless it
1411
// was changed.
1512
func (t *Tags) Keys() []string {}
@@ -21,7 +18,7 @@ type ItimerWhich int
2118
var ToolchainRE = "toolchain"
2219

2320
/*
24-
// PropertyBag
21+
// PropertyBag
2522
*/
2623
// Rectangle An area within an image.
27-
type Rectangle struct {}
24+
type Rectangle struct{}

‎testdata/exported_issue_519.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ package golint
33

44
// Test case for the configuration option tp replace the word "stutters" by "repetitive" failure messages
55

6-
// GolintRepetitive is a dummy function
6+
// GolintRepetitive is a dummy function
77
func GolintRepetitive() {} // MATCH /func name will be used as golint.GolintRepetitive by other packages, and that is repetitive; consider calling this Repetitive/

‎testdata/exported_issue_555.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ package golint
33

44
// Test case for disabling stuttering check in exported rule
55

6-
// GolintSomething is a dummy function
6+
// GolintSomething is a dummy function
77
func GolintSomething() {}

‎testdata/function_length_default.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,4 @@ func funLengthB(file *ast.File, fset *token.FileSet, lineLimit, stmtLimit int) [
131131
}
132132
}
133133
return
134-
}
134+
}

‎testdata/golint/blank_import_with_embed.go‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ package foo
66
import (
77
_ "embed"
88
_ "fmt"
9-
/* MATCH:8 /a blank import should be only in a main or test package, or have a comment justifying it/ */
10-
)
9+
/* MATCH:8 /a blank import should be only in a main or test package, or have a comment justifying it/ */)
1110

1211
//go:embed .gitignore
1312
var _ string
14-

‎testdata/golint/exported.go‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package golint
33

44
import "net/http"
55

6-
// GolintFoo is a dummy function
6+
// GolintFoo is a dummy function
77
func GolintFoo() {} // MATCH /func name will be used as golint.GolintFoo by other packages, and that stutters; consider calling this Foo/
88

99
type (
@@ -33,12 +33,11 @@ const FirstLetter = "A"
3333
/*Bar2 something */
3434
type Bar2 struct{}
3535

36+
/* Bar3 */ // MATCH /comment on exported type Bar3 should be of the form "Bar3 ..." (with optional leading article)/
37+
type Bar3 struct{}
3638

37-
/* Bar3 */ // MATCH /comment on exported type Bar3 should be of the form "Bar3 ..." (with optional leading article)/
38-
type Bar3 struct{}
39-
40-
/* BarXXX invalid */ // MATCH /comment on exported type Bar4 should be of the form "Bar4 ..." (with optional leading article)/
41-
type Bar4 struct{}
39+
/* BarXXX invalid */ // MATCH /comment on exported type Bar4 should be of the form "Bar4 ..." (with optional leading article)/
40+
type Bar4 struct{}
4241

4342
/*Toto2 something */
4443
func Toto2() {}
@@ -47,15 +46,15 @@ func Toto2() {}
4746
const SecondLetter = "B"
4847

4948
// Tests for common method names
50-
//// Should NOT fail for methods
49+
// Should NOT fail for methods
5150
func (_) Error() string { return "" }
5251
func (_) String() string { return "" }
5352
func (_) ServeHTTP(w http.ResponseWriter, r *http.Request) {}
5453
func (_) Read(p []byte) (n int, err error) { return 0, nil }
5554
func (_) Write(p []byte) (n int, err error) { return 0, nil }
5655
func (_) Unwrap(err error) error { return nil }
5756

58-
//// Should fail for functions
57+
// Should fail for functions
5958

6059
func Error() string { return "" } // MATCH /exported function Error should have comment or be unexported/
6160
func String() string { return "" } // MATCH /exported function String should have comment or be unexported/

0 commit comments

Comments
 (0)