Menu

"%w wants operand of error type": Go 1.27's New vet Check
📰

"%w wants operand of error type": Go 1.27's New vet Check

DEV Community: go·Nithin Bharadwaj·12 days ago
#rBYYZEEI
#devtogo#devto#dev#error#errors
Long article (2551 words) — no AI summary yet.
Reading 0:00
15s threshold

As a best-selling author, I invite you to explore my books on Amazon . Don't forget to follow me on Medium and show your support. Thank you! Your support means the world!

On 21 August 2026, two days after Go 1.27 shipped, a developer named Steven Hartland posted a failing build to golang-nuts . His test file had stopped passing, and this was the line he pasted.

./prog_test.go:27:44: %w wants operand of error type HTTPError, not pointer type *HTTPError (defeats errors.Is)

Enter fullscreen mode

Exit fullscreen mode

He summed it up like this. "Under go 1.26 the errors.Is works as expected but under 1.27 you get a compile failure." So he did what the message seemed to ask and removed the & . Then, in his words, "two of the tests fail as HTTPError is not comparable." He added a custom Is method. Vet still complained.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.