unused/testdata/src/example.com/implicit-conversion/implicit-conversion.go
raw| 1 | package pkg |
| 2 | |
| 3 | // https://staticcheck.dev/issues/810 |
| 4 | |
| 5 | type Thing struct { //@ used("Thing", true) |
| 6 | has struct { //@ used("has", true) |
| 7 | a bool //@ used("a", true) |
| 8 | } |
| 9 | } |
| 10 | |
| 11 | func Fn() { //@ used("Fn", true) |
| 12 | type temp struct { //@ used("temp", true) |
| 13 | a bool //@ used("a", true) |
| 14 | } |
| 15 | |
| 16 | x := Thing{ //@ used("x", true) |
| 17 | has: temp{true}, |
| 18 | } |
| 19 | _ = x |
| 20 | } |