diff --git a/builder/alicloud/ecs/image_config.go b/builder/alicloud/ecs/image_config.go index 517d345de..a7e5f008c 100644 --- a/builder/alicloud/ecs/image_config.go +++ b/builder/alicloud/ecs/image_config.go @@ -205,7 +205,7 @@ func (c *AlicloudImageConfig) Prepare(ctx *interpolate.Context) []error { strings.HasPrefix(c.AlicloudImageName, "https://") { errs = append(errs, fmt.Errorf("image_name can't start with 'http://' or 'https://'")) } - reg := regexp.MustCompile("\\s+") + reg := regexp.MustCompile(`\s+`) if reg.FindString(c.AlicloudImageName) != "" { errs = append(errs, fmt.Errorf("image_name can't include spaces")) } diff --git a/builder/azure/arm/config.go b/builder/azure/arm/config.go index 4a8e80cfb..85b4b0290 100644 --- a/builder/azure/arm/config.go +++ b/builder/azure/arm/config.go @@ -55,12 +55,12 @@ const ( ) var ( - reCaptureContainerName = regexp.MustCompile("^[a-z0-9][a-z0-9\\-]{2,62}$") - reCaptureNamePrefix = regexp.MustCompile("^[A-Za-z0-9][A-Za-z0-9_\\-\\.]{0,23}$") + reCaptureContainerName = regexp.MustCompile(`^[a-z0-9][a-z0-9\-]{2,62}$`) + reCaptureNamePrefix = regexp.MustCompile(`^[A-Za-z0-9][A-Za-z0-9_\-\.]{0,23}$`) reManagedDiskName = regexp.MustCompile(validManagedDiskName) reResourceGroupName = regexp.MustCompile(validResourceGroupNameRe) - reSnapshotName = regexp.MustCompile("^[A-Za-z0-9_]{1,79}$") - reSnapshotPrefix = regexp.MustCompile("^[A-Za-z0-9_]{1,59}$") + reSnapshotName = regexp.MustCompile(`^[A-Za-z0-9_]{1,79}$`) + reSnapshotPrefix = regexp.MustCompile(`^[A-Za-z0-9_]{1,59}$`) ) type PlanInformation struct { diff --git a/builder/qemu/driver.go b/builder/qemu/driver.go index eb1992ba6..000c0b915 100644 --- a/builder/qemu/driver.go +++ b/builder/qemu/driver.go @@ -189,7 +189,7 @@ func (d *QemuDriver) Version() (string, error) { versionOutput := strings.TrimSpace(stdout.String()) log.Printf("Qemu --version output: %s", versionOutput) - versionRe := regexp.MustCompile("[\\.[0-9]+]*") + versionRe := regexp.MustCompile(`[\.[0-9]+]*`) matches := versionRe.FindStringSubmatch(versionOutput) if len(matches) == 0 { return "", fmt.Errorf("No version found: %s", versionOutput)