validateName rejects empty names and names containing path separators.
(name string)
| 99 | |
| 100 | // validateName rejects empty names and names containing path separators. |
| 101 | func validateName(name string) error { |
| 102 | if strings.TrimSpace(name) == "" { |
| 103 | return fmt.Errorf("%w: name is empty", ErrInvalidName) |
| 104 | } |
| 105 | if strings.ContainsAny(name, `/\`) { |
| 106 | return fmt.Errorf("%w: name %q contains a path separator", ErrInvalidName, name) |
| 107 | } |
| 108 | return nil |
| 109 | } |
| 110 | |
| 111 | // List returns all instructions (without installs) ordered by name. |
| 112 | func (s *Store) List(ctx context.Context) ([]Instruction, error) { |