package errtools import ( "errors" "strings" ) func IsPortMissingErr(err error) bool { for { if err == nil { return false } if strings.Contains(err.Error(), "missing port in address") { return true } err = errors.Unwrap(err) } }