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

EnvelopeVerifier.Verify should not use fmt.Printf #16

Open
nmiyake opened this issue Mar 11, 2022 · 0 comments
Open

EnvelopeVerifier.Verify should not use fmt.Printf #16

nmiyake opened this issue Mar 11, 2022 · 0 comments
Labels
good first issue Good for newcomers

Comments

@nmiyake
Copy link
Contributor

nmiyake commented Mar 11, 2022

Currently, the logic in EnvelopeVerifier.Verify uses fmt.Printf to print a warning in one of its code paths: fmt.Printf("Found envelope signed by different subkeys of the same main key, Only one of them is counted towards the step threshold, KeyID=%s\n", keyID)

This is an anti-pattern for a library: the consumer of the library may want to control what is printed to os.Stdout, so libraries should not use fmt.Printf to print directly to it. If this is a legitimate error case it should be returned as an error; otherwise, it should not print output. If logging is desired then it could be done if a logging library is added/used (which is still not great for library functions), but printing directly to os.Stdout is incorrect.

@adityasaky adityasaky added the good first issue Good for newcomers label May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants