| 1 |
# Test of line-oriented output. |
| 2 |
|
| 3 |
deadcode `-f={{range .Funcs}}{{printf "%s: %s.%s\n" .Position $.Path .Name}}{{end}}` -filter= example.com |
| 4 |
|
| 5 |
want "main.go:13:10: example.com.T.Goodbye" |
| 6 |
!want "example.com.T.Hello" |
| 7 |
want "main.go:15:6: example.com.unreferenced" |
| 8 |
|
| 9 |
want "fmt.Scanf" |
| 10 |
want "fmt.Printf" |
| 11 |
!want "fmt.Println" |
| 12 |
|
| 13 |
-- go.mod -- |
| 14 |
module example.com |
| 15 |
go 1.18 |
| 16 |
|
| 17 |
-- main.go -- |
| 18 |
package main |
| 19 |
|
| 20 |
import "fmt" |
| 21 |
|
| 22 |
type T int |
| 23 |
|
| 24 |
func main() { |
| 25 |
var x T |
| 26 |
x.Hello() |
| 27 |
} |
| 28 |
|
| 29 |
func (T) Hello() { fmt.Println("hello") } |
| 30 |
func (T) Goodbye() { fmt.Println("goodbye") } |
| 31 |
|
| 32 |
func unreferenced() {} |