Skip to content

EnvelopeVerifier.Verify should not use fmt.Printf #16

@nmiyake

Description

@nmiyake

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions