(s string)
| 182 | const pluginNameFormat = `^[a-z][a-z0-9]*$` |
| 183 | |
| 184 | func isValidPluginName(s string) bool { |
| 185 | if len(s) == 0 { |
| 186 | return false |
| 187 | } |
| 188 | // first character must be a-z |
| 189 | if c := s[0]; c < 'a' || c > 'z' { |
| 190 | return false |
| 191 | } |
| 192 | // followed by a-z or 0-9 |
| 193 | for i := 1; i < len(s); i++ { |
| 194 | c := s[i] |
| 195 | if (c < 'a' || c > 'z') && (c < '0' || c > '9') { |
| 196 | return false |
| 197 | } |
| 198 | } |
| 199 | return true |
| 200 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…