Skip to content

Commit dbe4994

Browse files
committed
Mage: Implement static check recommendations.
1 parent c6a4817 commit dbe4994

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

magefiles/steps/release.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (Release) NewReleaseFromOld(version, oldversion string) {
7474
func (Release) E2EDocs() {
7575
e2edocs, err := utils.GenerateE2EDocs()
7676
utils.CheckIfError(err, "error on template")
77-
err = os.WriteFile("docs/e2e-tests.md", []byte(e2edocs), 644)
77+
err = os.WriteFile("docs/e2e-tests.md", []byte(e2edocs), 0644)
7878
utils.CheckIfError(err, "Could not write new e2e test file ")
7979
}
8080

@@ -158,7 +158,7 @@ func updateIndexMD(old, new string) error {
158158
utils.CheckIfError(err, "Could not read INDEX_DOCS file %s", INDEX_DOCS)
159159
datString := string(data)
160160
datString = strings.Replace(datString, old, new, -1)
161-
err = os.WriteFile(INDEX_DOCS, []byte(datString), 644)
161+
err = os.WriteFile(INDEX_DOCS, []byte(datString), 0644)
162162
if err != nil {
163163
utils.ErrorF("Could not write new %s %s", INDEX_DOCS, err)
164164
return err
@@ -255,7 +255,7 @@ func makeReleaseNotes(newVersion, oldVersion string) (*utils.ReleaseNote, error)
255255

256256
// the newControllerVersion should match the latest tag
257257
if newControllerVersion != allControllerTags[0] {
258-
return nil, errors.New(fmt.Sprintf("Generating release new version %s didnt match the current latest tag %s", newControllerVersion, allControllerTags[0]))
258+
return nil, fmt.Errorf("generating release new version %s didnt match the current latest tag %s", newControllerVersion, allControllerTags[0])
259259
}
260260
// previous version
261261
newReleaseNotes.PreviousControllerVersion = allControllerTags[1]
@@ -272,8 +272,8 @@ func makeReleaseNotes(newVersion, oldVersion string) (*utils.ReleaseNote, error)
272272
var allUpdates []string
273273
var depUpdates []string
274274
var helmUpdates []string
275-
prRegex := regexp.MustCompile("\\(#\\d+\\)")
276-
depBot := regexp.MustCompile("^(\\w){1,10} Bump ")
275+
prRegex := regexp.MustCompile(`\(#\d+\)`)
276+
depBot := regexp.MustCompile(`^(\w){1,10} Bump `)
277277
helmRegex := regexp.MustCompile("helm|chart")
278278
for i, s := range commits {
279279
// matches on PR
@@ -322,13 +322,13 @@ func makeReleaseNotes(newVersion, oldVersion string) (*utils.ReleaseNote, error)
322322
controllerDigest := utils.FindImageDigest(data, "controller", newVersion)
323323
if len(controllerDigest) == 0 {
324324
utils.ErrorF("Controller Digest could not be found")
325-
return nil, errors.New("Controller digest could not be found")
325+
return nil, errors.New("controller digest could not be found")
326326
}
327327

328328
controllerChrootDigest := utils.FindImageDigest(data, "controller-chroot", newVersion)
329329
if len(controllerChrootDigest) == 0 {
330330
utils.ErrorF("Controller Chroot Digest could not be found")
331-
return nil, errors.New("Controller Chroot digest could not be found")
331+
return nil, errors.New("controller chroot digest could not be found")
332332
}
333333

334334
utils.Debug("Latest Controller Digest %v", controllerDigest)

0 commit comments

Comments
 (0)