nuclei/v2/pkg/utils/utils.go

26 lines
367 B
Go
Raw Normal View History

package utils
import (
2021-10-30 13:46:07 +03:00
"errors"
"strings"
)
func IsBlank(value string) bool {
return strings.TrimSpace(value) == ""
}
func IsNotBlank(value string) bool {
return !IsBlank(value)
}
2021-10-30 13:46:07 +03:00
func UnwrapError(err error) error {
for { // get the last wrapped error
unwrapped := errors.Unwrap(err)
if unwrapped == nil {
break
}
err = unwrapped
}
return err
}