blob: 6ba006d6aa692abde90ce5e8e290fd8cc3fa3966 [file] [log] [blame]
# Test of line-oriented output.
deadcode `-f={{range .Funcs}}{{printf "%s: %s.%s\n" .Position $.Path .Name}}{{end}}` -filter= example.com
want "main.go:13:10: example.com.T.Goodbye"
!want "example.com.T.Hello"
want "main.go:15:6: example.com.unreferenced"
want "fmt.Scanf"
want "fmt.Printf"
!want "fmt.Println"
-- go.mod --
module example.com
go 1.18
-- main.go --
package main
import "fmt"
type T int
func main() {
var x T
x.Hello()
}
func (T) Hello() { fmt.Println("hello") }
func (T) Goodbye() { fmt.Println("goodbye") }
func unreferenced() {}