Closed
Description
What is the URL of the page with the issue?
https://go.dev/doc/tutorial/add-a-test
What is your user agent?
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0
Screenshot
What did you do?
Follow the steps in the tutorial.
What did you expect to see?
I expected to see the same command output for go test
in the tutorial as on my local machine when executing the command.
What did you see instead?
For step 5, the outputs don't match. It seems like go now does advanced code checking and already detects a static issue without running the actual test.
Tutorial Output
$ go test
--- FAIL: TestHelloName (0.00s)
greetings_test.go:15: Hello("Gladys") = "Hail, %v! Well met!", <nil>, want match for `\bGladys\b`, nil
FAIL
exit status 1
FAIL example.com/greetings 0.182s
Local Output
using go version go1.24.2 windows/amd64
$ go test
# exammple.com/greetings
# [exammple.com/greetings]
.\greetings.go:20:25: non-constant format string in call to fmt.Sprintf
FAIL exammple.com/greetings [build failed]