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: printf findings can be arbitrarily long #15907

Open
adonovan opened this Issue May 31, 2016 · 2 comments

Comments

Projects
None yet
4 participants
@adonovan

adonovan commented May 31, 2016

When vet reports a printf problem such as this one:

fmt.Printf("%d", func() { ... }) // arg in printf call is a function value, not a function call

it prints out the entire body of the function literal, which can be quite long.
For example, given the program at https://play.golang.org/p/f8W0zpISww, vet prints

% go vet ~/a.go
../../../../a.go:6: arg func() {
        println("blah")
        println("blah")
        println("blah")
... dozens more lines...
        println("blah")
        println("blah")
        println("blah")
} in printf call is a function value, not a function call

Perhaps it should not print the function body at all.

@josharian

This comment has been minimized.

Contributor

josharian commented May 31, 2016

@valyala

This comment has been minimized.

Contributor

valyala commented Jun 1, 2016

Currently long vet output isn't limited by -printf check and/or by long function bodies. For instance, complex composite literal may result in a long vet output too.

@quentinmit quentinmit added this to the Unplanned milestone Jun 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment