{"id":"c884e1cecba70eee","repo":"docker/cli","slug":"ip-address-is-not-correctly-formatted-s","errorCode":null,"errorMessage":"IP address is not correctly formatted: %s","messagePattern":"IP address is not correctly formatted: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"opts/opts.go","lineNumber":192,"sourceCode":"}\n\n// ValidatorFctType defines a validator function that returns a validated string and/or an error.\ntype ValidatorFctType func(val string) (string, error)\n\n// ValidatorFctListType defines a validator function that returns a validated list of string and/or an error\ntype ValidatorFctListType func(val string) ([]string, error)\n\n// ValidateIPAddress validates if the given value is a correctly formatted\n// IP address, and returns the value in normalized form. Leading and trailing\n// whitespace is allowed, but it does not allow IPv6 addresses surrounded by\n// square brackets (\"[::1]\").\n//\n// Refer to [net.ParseIP] for accepted formats.\nfunc ValidateIPAddress(val string) (string, error) {\n\tif ip := net.ParseIP(strings.TrimSpace(val)); ip != nil {\n\t\treturn ip.String(), nil\n\t}\n\treturn \"\", fmt.Errorf(\"IP address is not correctly formatted: %s\", val)\n}\n\n// ValidateMACAddress validates a MAC address.\n//\n// Deprecated: use [net.ParseMAC]. This function will be removed in the next release.\nfunc ValidateMACAddress(val string) (string, error) {\n\t_, err := net.ParseMAC(strings.TrimSpace(val))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn val, nil\n}\n\n// ValidateDNSSearch validates domain for resolvconf search configuration.\n// A zero length domain is represented by a dot (.).\nfunc ValidateDNSSearch(val string) (string, error) {\n\tif val = strings.Trim(val, \" \"); val == \".\" {\n\t\treturn val, nil","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/opts/opts.go#L174-L210","documentation":"Error \"IP address is not correctly formatted: %s\" thrown in docker/cli.","triggerScenarios":"Thrown at opts/opts.go:192 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}