| # Regression test for issue 65915: the enumeration of source-level | |
| # functions used the flawed ssautil.AllFunctions, causing it to | |
| # miss some unexported ones. | |
| deadcode -filter= example.com | |
| want "unreachable func: example.UnUsed" | |
| want "unreachable func: example.unUsed" | |
| want "unreachable func: PublicExample.UnUsed" | |
| want "unreachable func: PublicExample.unUsed" | |
| -- go.mod -- | |
| module example.com | |
| go 1.18 | |
| -- main.go -- | |
| package main | |
| type example struct{} | |
| func (e example) UnUsed() {} | |
| func (e example) Used() {} | |
| func (e example) unUsed() {} | |
| func (e example) used() {} | |
| type PublicExample struct{} | |
| func (p PublicExample) UnUsed() {} | |
| func (p PublicExample) Used() {} | |
| func (p PublicExample) unUsed() {} | |
| func (p PublicExample) used() {} | |
| func main() { | |
| example{}.Used() | |
| example{}.used() | |
| PublicExample{}.Used() | |
| PublicExample{}.used() | |
| } |