pkg/units: Updated Compile() to MustCompile()

We were doing exactly what `regexp.MustCompile()` already does.

Docker-DCO-1.1-Signed-off-by: fcarriedo <fcarriedo@gmail.com> (github: fcarriedo)
This commit is contained in:
fcarriedo 2014-07-24 12:34:11 -07:00
parent 386d300a6e
commit c765134ac9

View file

@ -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"}