golangci-lint/test/testdata/exhaustivestruct.go
Mateusz Bilski 55e35d27e3
Update exhaustivestruct (#1472)
* Update exhaustivestruct

* Add tests
2020-10-27 00:54:55 +01:00

25 lines
314 B
Go

//args: -Eexhaustivestruct
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",
}