package utils import ( "fmt" "github.com/go-resty/resty/v2" uuid "github.com/satori/go.uuid" "strings" ) func AllBlank(str ...string) bool { for _, s := range str { if !HasBlank(s) { return false } } return true } func HasBlank(str ...string) bool { for _, s := range str { if strings.Trim(s, " ") == "" { return true } } return false } func HasText(str ...string) bool { for _, s := range str { if strings.Trim(s, " ") != "" { return true } } return false } func GetUUID() string { return uuid.NewV4().String() } func SimpleUUID() string { return strings.ReplaceAll(GetUUID(), "-", "") } func ResponseStatusError(url string, resp *resty.Response) error { if resp.Body() != nil && len(resp.Body()) != 0 { return fmt.Errorf("URL: %s Status: %d %s\n", url, resp.StatusCode(), resp.Body()) } else { return fmt.Errorf("URL: %s Status: %s\n", url, resp.Status()) } }