Skip to content

Commit 5694c50

Browse files
build(deps): bump github.com/mbilski/exhaustivestruct from 1.1.0 to 1.2.0 (#1680)
1 parent 55eed96 commit 5694c50

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ require (
3838
github.com/maratori/testpackage v1.0.1
3939
github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb // v1.0
4040
github.com/mattn/go-colorable v0.1.8
41-
github.com/mbilski/exhaustivestruct v1.1.0
41+
github.com/mbilski/exhaustivestruct v1.2.0
4242
github.com/mitchellh/go-homedir v1.1.0
4343
github.com/mitchellh/go-ps v1.0.0
4444
github.com/moricho/tparallel v0.2.1

go.sum

+6-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/testdata/exhaustivestruct.go

+10-1
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,30 @@ package testdata
44
type Test struct {
55
A string
66
B int
7-
c bool // ignore private field
7+
c bool // private field inside the same package are not ignored
88
D float64
99
}
1010

1111
var pass = Test{
12+
A: "a",
13+
B: 0,
14+
c: false,
15+
D: 1.0,
16+
}
17+
18+
var failPrivate = Test{ // ERROR "c is missing in Test"
1219
A: "a",
1320
B: 0,
1421
D: 1.0,
1522
}
1623

1724
var fail = Test{ // ERROR "B is missing in Test"
1825
A: "a",
26+
c: false,
1927
D: 1.0,
2028
}
2129

2230
var failMultiple = Test{ // ERROR "B, D are missing in Test"
2331
A: "a",
32+
c: false,
2433
}

test/testdata/wrapcheck.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
//args: -Ewrapcheck
2-
package main
2+
package testdata
33

44
import (
55
"encoding/json"
66
)
77

8-
func main() {
9-
do()
10-
}
11-
128
func do() error {
139
_, err := json.Marshal(struct{}{})
1410
if err != nil {

0 commit comments

Comments
 (0)