MCPcopy
hub / github.com/spf13/cobra / WriteStringAndCheck

Function WriteStringAndCheck

cobra.go:243–246  ·  cobra.go::WriteStringAndCheck

WriteStringAndCheck writes a string into a buffer, and checks if the error is not nil.

(b io.StringWriter, s string)

Source from the content-addressed store, hash-verified

241
242// WriteStringAndCheck writes a string into a buffer, and checks if the error is not nil.
243func WriteStringAndCheck(b io.StringWriter, s string) {
244 _, err := b.WriteString(s)
245 CheckErr(err)
246}

Callers 15

manPreambleFunction · 0.92
manPrintFlagsFunction · 0.92
manPrintOptionsFunction · 0.92
genFishCompFunction · 0.85
genBashCompFunction · 0.85
CompDebugFunction · 0.85
genPowerShellCompFunction · 0.85
genZshCompFunction · 0.85
writePreambleFunction · 0.85
writePostscriptFunction · 0.85
writeCommandsFunction · 0.85
writeFlagHandlerFunction · 0.85

Calls 1

CheckErrFunction · 0.85

Tested by

no test coverage detected