From c765134ac954f54f8b6aca6df25cf5e28911b563 Mon Sep 17 00:00:00 2001 From: fcarriedo Date: Thu, 24 Jul 2014 12:34:11 -0700 Subject: [PATCH] pkg/units: Updated `Compile()` to `MustCompile()` We were doing exactly what `regexp.MustCompile()` already does. Docker-DCO-1.1-Signed-off-by: fcarriedo (github: fcarriedo) --- pkg/units/size.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/units/size.go b/pkg/units/size.go index 50e8ec6c81..1594cd6549 100644 --- a/pkg/units/size.go +++ b/pkg/units/size.go @@ -15,10 +15,7 @@ const ( var sizeRegex *regexp.Regexp func init() { - var err error - if sizeRegex, err = regexp.Compile("^(\\d+)([kKmMgGtTpP])?[bB]?$"); err != nil { - panic("Failed to compile the 'size' regular expression") - } + sizeRegex = regexp.MustCompile("^(\\d+)([kKmMgGtTpP])?[bB]?$") } var bytePrefixes = [...]string{"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"}