MCPcopy Index your code
hub / github.com/dnote/dnote / Askf

Function Askf

pkg/cli/log/log.go:97–108  ·  view source on GitHub ↗

Askf prints an question with optional format verbs. The leading symbol differs in color depending on whether the input is masked.

(msg string, masked bool, v ...interface{})

Source from the content-addressed store, hash-verified

95// Askf prints an question with optional format verbs. The leading symbol differs in color depending
96// on whether the input is masked.
97func Askf(msg string, masked bool, v ...interface{}) {
98 symbolChar := "[?]"
99
100 var symbol string
101 if masked {
102 symbol = ColorGray.Sprintf("%s", symbolChar)
103 } else {
104 symbol = ColorGreen.Sprintf("%s", symbolChar)
105 }
106
107 fmt.Fprintf(color.Output, "%s%s %s: ", indent, symbol, fmt.Sprintf(msg, v...))
108}
109
110// isDebug returns true if debug mode is enabled
111func isDebug() bool {

Callers 3

PromptInputFunction · 0.92
PromptPasswordFunction · 0.92
ConfirmFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected