MCPcopy
hub / github.com/cli/cli / HostnameValidator

Function HostnameValidator

internal/ghinstance/host.go:36–44  ·  view source on GitHub ↗
(hostname string)

Source from the content-addressed store, hash-verified

34}
35
36func HostnameValidator(hostname string) error {
37 if len(strings.TrimSpace(hostname)) < 1 {
38 return errors.New("a value is required")
39 }
40 if strings.ContainsRune(hostname, '/') || strings.ContainsRune(hostname, ':') {
41 return errors.New("invalid hostname")
42 }
43 return nil
44}
45
46func GraphQLEndpoint(hostname string) string {
47 if isGarage(hostname) {

Callers 5

NewCmdLoginFunction · 0.92
NewCmdApiFunction · 0.92
AreFlagsValidMethod · 0.92
InputHostnameMethod · 0.92
TestHostnameValidatorFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestHostnameValidatorFunction · 0.68