(provided string, allowed string, allowedVals ...string)
| 256 | } |
| 257 | |
| 258 | func ErrorInvalidStr(provided string, allowed string, allowedVals ...string) error { |
| 259 | allAllowedVals := append([]string{allowed}, allowedVals...) |
| 260 | return errors.WithStack(&errors.Error{ |
| 261 | Kind: ErrInvalidStr, |
| 262 | Message: fmt.Sprintf("invalid value (got %s, must be %s)", s.UserStr(provided), s.UserStrsOr(allAllowedVals)), |
| 263 | }) |
| 264 | } |
| 265 | |
| 266 | func ErrorDisallowedValue(provided interface{}) error { |
| 267 | return errors.WithStack(&errors.Error{ |
no test coverage detected