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: check for verb errors for fmt.Scanf #8170

Open
jcrubino opened this issue Jun 8, 2014 · 2 comments
Open

cmd/vet: check for verb errors for fmt.Scanf #8170

jcrubino opened this issue Jun 8, 2014 · 2 comments
Labels
Analysis Issues related to static analysis (vet, x/tools/go/analysis)
Milestone

Comments

@jcrubino
Copy link

jcrubino commented Jun 8, 2014

What does 'go version' print?
go version go1.2.2 linux/amd64

What steps reproduce the problem?
If possible, include a link to a program on play.golang.org.

1. Printf("test %d", f) where f is float is deemed a type error
2. Scanf("test %d", f) where f is float passes all type checking
3. http://play.golang.org/p/3OkpJ-RQeU
4. code sample will compile and pass go vet but fail at runtime

What happened?
Simple demo program using fmt.Scanf compiles  and passes go vet check but error found at
runtime.  Analogous program using fmt.Printf with same error does not pass go vet check.

What should have happened instead?
go vet should produce similar checks in fmt.Scanf as is does for fmt.Printf

Please provide any additional information below.
@minux
Copy link
Member

minux commented Jun 8, 2014

Comment 1:

Labels changed: added release-go1.4, repo-tools.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Sep 15, 2014

Comment 2:

Probably too much for right now, but a good idea.

Labels changed: added release-go1.5, removed release-go1.4.

@bradfitz bradfitz modified the milestone: Go1.5 Dec 16, 2014
@robpike robpike self-assigned this Jan 6, 2015
@rsc rsc removed accepted labels Apr 14, 2015
@rsc rsc changed the title cmd/vet: check for verb errors for fmt.Scanf x/tools/cmd/vet: check for verb errors for fmt.Scanf Apr 14, 2015
@rsc rsc modified the milestones: Unreleased, Go1.5 Apr 14, 2015
@rsc rsc removed the repo-tools label Apr 14, 2015
@mvdan mvdan changed the title x/tools/cmd/vet: check for verb errors for fmt.Scanf cmd/vet: check for verb errors for fmt.Scanf May 31, 2018
@odeke-em odeke-em self-assigned this Jun 7, 2020
@rsc rsc unassigned robpike and odeke-em Jun 23, 2022
@adonovan adonovan added the Analysis Issues related to static analysis (vet, x/tools/go/analysis) label Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Analysis Issues related to static analysis (vet, x/tools/go/analysis)
Projects
None yet
Development

No branches or pull requests

7 participants