Why is this panicf-sprintf causing a type error in Golang 1.11? Go doesn't explain the reason, even if it says this is a common mistake.
https://golang.org/doc/go1.11#vet
go vet
is now enforced during the build.
func panicf(s string, i ...interface{}) { panic(fmt.Sprintf(s, i)) }
The test is returning
missing ... in args forwarded to printf-like function
vet
describes this as
func (*ptrStringer) BadWrap(x int, args ...interface{}) string {
return fmt.Sprint(args) // ERROR "missing ... in args forwarded to print-like function"
}
func (*ptrStringer) BadWrapf(x int, format string, args ...interface{}) string {
return fmt.Sprintf(format, args) // ERROR "missing ... in args forwarded to printf-like function"
Please help explain ...
in golang in this context.
Here is a functional playground: https://play.golang.org/p/DijjanQNkxK