Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/vet: false positive in Printf recursive Stringer check with non-matching String() functions #30441

reillywatson opened this issue Feb 27, 2019 · 2 comments


Copy link

@reillywatson reillywatson commented Feb 27, 2019

What version of Go are you using (go version)?

$ go version

Does this issue reproduce with the latest release?


What operating system and processor architecture are you using (go env)?

What did you do?

package main

import (

type Foo int
func (f Foo) String() (string, error) {
	return "", fmt.Errorf("%v", f)

func main() {
	s, err := Foo(1).String()
	fmt.Println(s, err)

What did you expect to see?

No vet output

What did you see instead?

prog.go:9:13: Errorf format %v with arg f causes recursive String method call

Copy link

@gopherbot gopherbot commented Feb 27, 2019

Change mentions this issue: cmd/vet: verify potentially-recursive Stringers are actuually Stringers

@bcmills bcmills added this to the Go1.13 milestone Feb 27, 2019
@golang golang locked and limited conversation to collaborators Apr 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants