mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
daemon/names: use lazyregexp
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
package names // import "github.com/docker/docker/daemon/names"
|
||||
|
||||
import "regexp"
|
||||
import "github.com/docker/docker/internal/lazyregexp"
|
||||
|
||||
// RestrictedNameChars collects the characters allowed to represent a name, normally used to validate container and volume names.
|
||||
const RestrictedNameChars = `[a-zA-Z0-9][a-zA-Z0-9_.-]`
|
||||
|
||||
// RestrictedNamePattern is a regular expression to validate names against the collection of restricted characters.
|
||||
var RestrictedNamePattern = regexp.MustCompile(`^` + RestrictedNameChars + `+$`)
|
||||
var RestrictedNamePattern = lazyregexp.New(`^` + RestrictedNameChars + `+$`)
|
||||
|
||||
Reference in New Issue
Block a user