Skip to content

Commit 43d956f

Browse files
committed
add tests
1 parent 9516947 commit 43d956f

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

Diff for: test/testdata/fix/in/govet_fieldalignment.go

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//args: -Egovet
2+
//config: linters-settings.govet.enable=fieldalignment
3+
package p
4+
5+
import "log"
6+
7+
type gvfaGood struct {
8+
y int32
9+
x byte
10+
z byte
11+
}
12+
13+
type gvfaBad struct {
14+
x byte
15+
y int32
16+
z byte
17+
}
18+
19+
func test() {
20+
g := gvfaGood{1, 2, 3}
21+
b := gvfaBad{1, 2, 3}
22+
log.Printf("good: %v; bad: %v", g, b)
23+
}

Diff for: test/testdata/fix/out/govet_fieldalignment.go

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//args: -Egovet
2+
//config: linters-settings.govet.enable=fieldalignment
3+
package p
4+
5+
import "log"
6+
7+
type gvfaGood struct {
8+
y int32
9+
x byte
10+
z byte
11+
}
12+
13+
type gvfaBad struct {
14+
x byte
15+
y int32
16+
z byte
17+
}
18+
19+
func test() {
20+
g := gvfaGood{1, 2, 3}
21+
b := gvfaBad{1, 2, 3}
22+
log.Printf("good: %v; bad: %v", g, b)
23+
}

0 commit comments

Comments
 (0)