diff --git a/go.mod b/go.mod index 589043b8..35b2c637 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/maratori/testpackage v1.0.1 github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb // v1.0 github.com/mattn/go-colorable v0.1.8 - github.com/mbilski/exhaustivestruct v1.0.1 + github.com/mbilski/exhaustivestruct v1.1.0 github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/go-ps v1.0.0 github.com/moricho/tparallel v0.2.1 diff --git a/go.sum b/go.sum index 937521b0..f6c51332 100644 --- a/go.sum +++ b/go.sum @@ -241,8 +241,8 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mbilski/exhaustivestruct v1.0.1 h1:FouWZOuwqC4YFgkbODefMA0lcuTLKArZLLpzKzjCMF0= -github.com/mbilski/exhaustivestruct v1.0.1/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= +github.com/mbilski/exhaustivestruct v1.1.0 h1:4ykwscnAFeHJruT+EY3M3vdeP8uXMh0VV2E61iR7XD8= +github.com/mbilski/exhaustivestruct v1.1.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= diff --git a/test/testdata/exhaustivestruct.go b/test/testdata/exhaustivestruct.go index 02206cb0..31113e3a 100644 --- a/test/testdata/exhaustivestruct.go +++ b/test/testdata/exhaustivestruct.go @@ -4,13 +4,21 @@ package testdata type Test struct { A string B int + c bool // ignore private field + D float64 } var pass = Test{ A: "a", B: 0, + D: 1.0, } var fail = Test{ // ERROR "B is missing in Test" A: "a", + D: 1.0, +} + +var failMultiple = Test{ // ERROR "B, D are missing in Test" + A: "a", }