MCPcopy Create free account
hub / github.com/cli/cli / PrintUnchanged

Function PrintUnchanged

pkg/cmd/issue/artifact/shared/results.go:61–67  ·  view source on GitHub ↗

PrintUnchanged prints the line for an artifact the command didn't change because it already was as asked, such as an artifact that already matches the version to restore. In a terminal, it reads "! " on stderr, like gh issue close on a closed issue, so stdout stays empty. Otherwise it is a

(ios *iostreams.IOStreams, r Result, message, reason string)

Source from the content-addressed store, hash-verified

59// piped line on stdout whose status is "skipped", with reason. It isn't a
60// failure, so the command exits 0 after it.
61func PrintUnchanged(ios *iostreams.IOStreams, r Result, message, reason string) {
62 if !ios.IsStdoutTTY() {
63 printResultLine(ios.Out, "skipped", r, reason)
64 return
65 }
66 fmt.Fprintf(ios.ErrOut, "%s %s\n", ios.ColorScheme().WarningIcon(), message)
67}
68
69// PrintFailure prints the line for an artifact the command couldn't act on,
70// with err's reason. In a terminal, it reads "X Failed to <action>: <reason>"

Callers 2

restoreVersionFunction · 0.92
TestPrintUnchangedFunction · 0.85

Calls 4

printResultLineFunction · 0.85
IsStdoutTTYMethod · 0.80
WarningIconMethod · 0.80
ColorSchemeMethod · 0.80

Tested by 1

TestPrintUnchangedFunction · 0.68