In order to determine whether a given type implements an interface using the reflect package, you need to pass a reflect.Type to reflect.Type.Implements(). How do you get one of those types?
As an example, trying to get the type of an uninitialized error
(interface) type does not work (it panics when you to call Kind() on it)
var err error
fmt.Printf("%#v
", reflect.TypeOf(err).Kind())
See Question&Answers more detail:os