(key string)
| 2355 | } |
| 2356 | |
| 2357 | func validateKey(key string) error { |
| 2358 | switch { |
| 2359 | case key == "": |
| 2360 | return errors.Errorf("Has zero length") |
| 2361 | case strings.ContainsAny(key, "~@"): |
| 2362 | return errors.Errorf("Has invalid characters") |
| 2363 | case strings.IndexFunc(key, unicode.IsSpace) != -1: |
| 2364 | return errors.Errorf("Must not contain spaces") |
| 2365 | } |
| 2366 | return nil |
| 2367 | } |
| 2368 | |
| 2369 | // validateKeys checks predicate and facet keys in N-Quad for syntax errors. |
| 2370 | func validateKeys(nq *api.NQuad) error { |
no test coverage detected
searching dependent graphs…