validateParamValue validates a parameter value per the ABNF grammar.
(value string)
| 341 | |
| 342 | // validateParamValue validates a parameter value per the ABNF grammar. |
| 343 | func validateParamValue(value string) error { |
| 344 | if value == "" { |
| 345 | return errors.New("model identifier: parameter value must not be empty (segment type: parameter value)") |
| 346 | } |
| 347 | if !reParamValue.MatchString(value) { |
| 348 | if r := firstForbiddenCharInParamValue(value); r != 0 { |
| 349 | return fmt.Errorf("model identifier: character %q is not allowed in parameter value %q (segment type: parameter value)", r, value) |
| 350 | } |
| 351 | } |
| 352 | return nil |
| 353 | } |
| 354 | |
| 355 | // UnrecognizedParams returns the list of parameter keys in params that are not |
| 356 | // defined in Section 6 (i.e., not effort or temperature). |
no test coverage detected