Commit c0b248c2 authored by Daniel Martí's avatar Daniel Martí
Browse files

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: default avatarRobert Griesemer <gri@golang.org>
Reviewed-by: default avatarRob Pike <r@golang.org>
parent 7ddd467e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment