package slerrors type badRequestError struct { Text string } func (err *badRequestError) Error() string { return "validation failed: " + err.Text } func BadRequest(text string) error { return &badRequestError{Text: text} } func IsBadRequest(err error) bool { _, ok := err.(*badRequestError) return ok }