From a304a7cfcc2628cd5379d085e868f5027201e672 Mon Sep 17 00:00:00 2001 From: Jonathan Boulle Date: Tue, 9 Sep 2014 09:47:55 -0700 Subject: [PATCH] api: fix consts block --- api/units.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/api/units.go b/api/units.go index 13a317a5e..84aa85ac9 100644 --- a/api/units.go +++ b/api/units.go @@ -104,12 +104,15 @@ func (ur *unitsResource) set(rw http.ResponseWriter, req *http.Request, item str ur.update(rw, su.Name, su.DesiredState) } -const unitNameMax = 256 -const digits = "0123456789" -const lowercase = "abcdefghijklmnopqrstuvwxyz" -const uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" -const alphanumerical = digits + lowercase + uppercase -const validChars = alphanumerical + `:=+.\@` +const ( + // These constants taken from systemd + unitNameMax = 256 + digits = "0123456789" + lowercase = "abcdefghijklmnopqrstuvwxyz" + uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + alphanumerical = digits + lowercase + uppercase + validChars = alphanumerical + `:=+.\@` +) var validUnitTypes = pkg.NewUnsafeSet( "service",