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

Function notFound

script/ghmock/schemacmd.go:621–626  ·  view source on GitHub ↗

notFound is an error for a name that doesn't exist. It suggests close matches.

(msg, name string, candidates []string)

Source from the content-addressed store, hash-verified

619// notFound is an error for a name that doesn't exist. It suggests close
620// matches.
621func notFound(msg, name string, candidates []string) error {
622 if matches := closeMatches(name, candidates, 5); len(matches) > 0 {
623 return fmt.Errorf("%s; did you mean %s?", msg, strings.Join(matches, ", "))
624 }
625 return errors.New(msg)
626}
627
628// closeMatches finds candidates that differ from name only in case, by a typo
629// or two, or that contain it.

Callers 2

describeGraphQLFunction · 0.85
missingChildFunction · 0.85

Calls 3

closeMatchesFunction · 0.85
JoinMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected