validateStackName checks if the provided string is a valid stack name (namespace). It currently only does a rudimentary check if the string is empty, or consists of only whitespace and quoting characters.
(namespace string)
| 15 | // It currently only does a rudimentary check if the string is empty, or consists |
| 16 | // of only whitespace and quoting characters. |
| 17 | func validateStackName(namespace string) error { |
| 18 | v := strings.TrimFunc(namespace, quotesOrWhitespace) |
| 19 | if v == "" { |
| 20 | return fmt.Errorf("invalid stack name: %q", namespace) |
| 21 | } |
| 22 | return nil |
| 23 | } |
| 24 | |
| 25 | func validateStackNames(namespaces []string) error { |
| 26 | for _, ns := range namespaces { |
no outgoing calls
no test coverage detected
searching dependent graphs…