]> Cypherpunks repositories - gostls13.git/commit
cmd/vet: replace hasMethod with isFormatter
authorDaniel Martí <mvdan@mvdan.cc>
Wed, 31 Jan 2018 20:53:44 +0000 (20:53 +0000)
committerDaniel Martí <mvdan@mvdan.cc>
Tue, 13 Feb 2018 21:19:57 +0000 (21:19 +0000)
commitc0b248c234e0a5e26d7dff77adf9a9f2a92a7a9c
treecc4186f2c237217becd0c8d8f00d809e1182e4f0
parent7ddd467ef335f9ea2347bb9c2628091568b3370f
cmd/vet: replace hasMethod with isFormatter

The former checks if a type has a method called "Format". The latter
checks if a type satisfies fmt.Formatter.

isFormatter does exactly what we want, so it's both simpler and more
accurate. Remove the only use of hasMethod in its favor.

Change-Id: Idc156a99081c3308f98512b87011a04aa8c6638d
Reviewed-on: https://go-review.googlesource.com/91215
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
src/cmd/vet/print.go
src/cmd/vet/types.go