summaryrefslogtreecommitdiff
path: root/pkg/machine/fedora.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/machine/fedora.go')
-rw-r--r--pkg/machine/fedora.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/pkg/machine/fedora.go b/pkg/machine/fedora.go
index bed45c6da..14a173da6 100644
--- a/pkg/machine/fedora.go
+++ b/pkg/machine/fedora.go
@@ -21,6 +21,8 @@ const (
githubURL = "http://github.com/fedora-cloud/docker-brew-fedora/"
)
+var fedoraxzRegex = regexp.MustCompile(`fedora[^\"]+xz`)
+
type FedoraDownload struct {
Download
}
@@ -96,12 +98,8 @@ func getFedoraDownload(releaseStream string) (string, *url.URL, int64, error) {
return "", nil, -1, err
}
- rx, err := regexp.Compile(`fedora[^\"]+xz`)
- if err != nil {
- return "", nil, -1, err
- }
- file := rx.FindString(string(body))
- if len(file) <= 0 {
+ file := fedoraxzRegex.FindString(string(body))
+ if len(file) == 0 {
return "", nil, -1, fmt.Errorf("could not locate Fedora download at %s", dirURL)
}