ValidateLabel return an error if the provided label contains any invalid characters, as determined by LabelRegexp.
(label string)
| 249 | // ValidateLabel return an error if the provided label contains any invalid |
| 250 | // characters, as determined by LabelRegexp. |
| 251 | func ValidateLabel(label string) error { |
| 252 | if !LabelRegexp.MatchString(label) { |
| 253 | return errors.Errorf("invalid label '%s'. Label must be non-empty, can only consist of alphanumerics, symbols from '.+-_', and can only begin with alphanumerics", label) |
| 254 | } |
| 255 | |
| 256 | return nil |
| 257 | } |
| 258 | |
| 259 | // Parse parses a set of bytes as a chaincode package |
| 260 | // and returns the parsed package as a struct |