MCPcopy
hub / github.com/larksuite/cli / formatMessage

Function formatMessage

errs/types.go:16–21  ·  view source on GitHub ↗

formatMessage applies fmt.Sprintf only when args are present, so a caller passing a literal message with a stray "%" (e.g. "disk 100% full") is not rendered as "%!(NOVERB)". `go vet -printf` catches most accidental format misuse upstream; this guard makes the constructor safe even when the message s

(format string, args []any)

Source from the content-addressed store, hash-verified

14// format misuse upstream; this guard makes the constructor safe even when
15// the message string is dynamically composed.
16func formatMessage(format string, args []any) string {
17 if len(args) == 0 {
18 return format
19 }
20 return fmt.Sprintf(format, args...)
21}
22
23// Typed error types and their builder APIs.
24//

Callers 15

NewValidationErrorFunction · 0.85
WithHintMethod · 0.85
NewAuthenticationErrorFunction · 0.85
WithHintMethod · 0.85
NewPermissionErrorFunction · 0.85
WithHintMethod · 0.85
NewConfigErrorFunction · 0.85
WithHintMethod · 0.85
NewNetworkErrorFunction · 0.85
WithHintMethod · 0.85
NewAPIErrorFunction · 0.85
WithHintMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected