Skip to content

Commit

Permalink
fix: resolve comment
Browse files Browse the repository at this point in the history
Signed-off-by: Junjie Gao <[email protected]>
  • Loading branch information
JeyJeyGao committed Feb 8, 2025
1 parent a029bd2 commit 1f6e1c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/notation/internal/display/metadata/text/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewVerifyHandler(printer *output.Printer) *VerifyHandler {

// OnResolvingTagReference outputs the tag reference warning.
func (h *VerifyHandler) OnResolvingTagReference(reference string) {
h.printer.ErrorPrintf("Warning: Always verify the artifact using digest(@sha256:...) rather than a tag(:%s) because resolved digest may not point to the same signed artifact, as tags are mutable.\n", reference)
h.printer.PrintErrorf("Warning: Always verify the artifact using digest(@sha256:...) rather than a tag(:%s) because resolved digest may not point to the same signed artifact, as tags are mutable.\n", reference)
}

// OnVerifySucceeded sets the successful verification result for the handler.
Expand All @@ -61,7 +61,7 @@ func (h *VerifyHandler) Render() error {
if result.Error != nil {
// at this point, the verification action has to be logged and
// it's failed
h.printer.ErrorPrintf("Warning: %v was set to %q and failed with error: %v\n", result.Type, result.Action, result.Error)
h.printer.PrintErrorf("Warning: %v was set to %q and failed with error: %v\n", result.Type, result.Action, result.Error)
}
}
if reflect.DeepEqual(h.outcome.VerificationLevel, trustpolicy.LevelSkip) {
Expand Down
4 changes: 2 additions & 2 deletions cmd/notation/internal/display/output/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ func (p *Printer) Printf(format string, a ...any) error {
return nil
}

// ErrorPrintf prints objects to error output concurrent-safely.
func (p *Printer) ErrorPrintf(format string, a ...any) error {
// PrintErrorf prints objects to error output concurrent-safely.
func (p *Printer) PrintErrorf(format string, a ...any) error {
p.lock.Lock()
defer p.lock.Unlock()

Expand Down

0 comments on commit 1f6e1c0

Please sign in to comment.