I discovered this while using the unused linter in golangci-lint. I hope I found the right place to report this issue. 🤞
Here's some code that reproduces it:
package unused_test
import "fmt"
type Thing struct {
stuff int
has struct {
a bool
b bool
}
}
func ExampleThing() {
type temp struct {
a bool
b bool
}
stuff := map[string]Thing{
"hello": {has: temp{true, false}},
}
fmt.Println(stuff["hello"].stuff, stuff["hello"].has)
// Output: 0 {true false}
}
Running ./golangci-lint run unused_test.go results in unused_test.go:14:7: type `temp` is unused (unused).