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: validate that time.Format strings are sane #14743

Open
cellofellow opened this issue Mar 10, 2016 · 3 comments
Open

cmd/vet: validate that time.Format strings are sane #14743

cellofellow opened this issue Mar 10, 2016 · 3 comments
Labels
Analysis Issues related to static analysis (vet, x/tools/go/analysis) Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@cellofellow
Copy link

vet will let the user know if fmt.Printf strings are incorrect and if the types passed to them are incorrect. It'd be very handy if the also rather specific format for time.Format strings were similarly checked for validity.

@bradfitz bradfitz added this to the Unplanned milestone Apr 10, 2016
@bradfitz bradfitz added the Suggested Issues that may be good for new contributors looking for work to do. label Apr 10, 2016
@rugginoso
Copy link
Contributor

@cellofellow could you provide some examples of wrong inputs and errors you'll expect?

@agnivade
Copy link
Contributor

fmt.Printf would still print something, albeit not what was intended. But time.Format would simply throw an error. So it's not like a mistake in the time.Format would go unnoticed so easily.

@alandonovan @mvdan

@adonovan adonovan added the Analysis Issues related to static analysis (vet, x/tools/go/analysis) label Apr 23, 2023
@adonovan
Copy link
Member

adonovan commented Apr 23, 2023

FYI: a timeformat checker for one very specific case now exists.

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) Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

No branches or pull requests

5 participants