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:
parent
386d300a6e
commit
c765134ac9
1 changed files with 1 additions and 4 deletions
|
@ -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"}
|
||||
|
|
Loading…
Reference in a new issue