You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running go test against test code that declares a Test* function with a wrong signature results in a somewhat unpleasant compile error:
dominikh-pc /tmp $ cat foo_test.go
package foo
func TestBroken(wrong, signature int) {}
dominikh-pc /tmp $ go test
# testmain
go-build299431253/_/tmp/_test/_testmain.go:22: cannot use foo.TestBroken (type func(int, int)) as type func(*testing.T) in field value
FAIL _/tmp [build failed]
dominikh-pc 2? /tmp $
It might be nice to check for the signature before compiling the test binary, to print a customized error.
The text was updated successfully, but these errors were encountered:
Running
go test
against test code that declares aTest*
function with a wrong signature results in a somewhat unpleasant compile error:It might be nice to check for the signature before compiling the test binary, to print a customized error.
The text was updated successfully, but these errors were encountered: