Skip to content

Commit 55e35d2

Browse files
authored
Update exhaustivestruct (#1472)
* Update exhaustivestruct * Add tests
1 parent f414375 commit 55e35d2

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ require (
3333
github.com/maratori/testpackage v1.0.1
3434
github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb // v1.0
3535
github.com/mattn/go-colorable v0.1.8
36-
github.com/mbilski/exhaustivestruct v1.0.1
36+
github.com/mbilski/exhaustivestruct v1.1.0
3737
github.com/mitchellh/go-homedir v1.1.0
3838
github.com/mitchellh/go-ps v1.0.0
3939
github.com/moricho/tparallel v0.2.1

go.sum

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/testdata/exhaustivestruct.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@ package testdata
44
type Test struct {
55
A string
66
B int
7+
c bool // ignore private field
8+
D float64
79
}
810

911
var pass = Test{
1012
A: "a",
1113
B: 0,
14+
D: 1.0,
1215
}
1316

1417
var fail = Test{ // ERROR "B is missing in Test"
1518
A: "a",
19+
D: 1.0,
20+
}
21+
22+
var failMultiple = Test{ // ERROR "B, D are missing in Test"
23+
A: "a",
1624
}

0 commit comments

Comments
 (0)