MCPcopy Create free account
hub / github.com/algolia/cli / ValidateNoControlChars

Function ValidateNoControlChars

pkg/cmdutil/validation.go:9–16  ·  view source on GitHub ↗

ValidateNoControlChars rejects identifier-like inputs containing control characters, which are easy to miss in automation and should never be valid.

(field, value string)

Source from the content-addressed store, hash-verified

7// ValidateNoControlChars rejects identifier-like inputs containing control
8// characters, which are easy to miss in automation and should never be valid.
9func ValidateNoControlChars(field, value string) error {
10 for _, r := range value {
11 if unicode.IsControl(r) {
12 return FlagErrorf("%s must not contain control characters", field)
13 }
14 }
15 return nil
16}

Callers 3

NewDeleteCmdFunction · 0.92
NewDeleteCmdFunction · 0.92
NewUnblockCmdFunction · 0.92

Calls 1

FlagErrorfFunction · 0.85

Tested by

no test coverage detected