From e156c4065041f5bd0e5c0836537c30e57dce4b9d Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Fri, 1 Sep 2023 13:21:47 +0800 Subject: [PATCH] chore: use raw string () with regexp.MustCompile to avoid having to escape twice --- operator/runner/env.go | 2 +- store/build/build.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/operator/runner/env.go b/operator/runner/env.go index 627143a5b1..12706a4652 100644 --- a/operator/runner/env.go +++ b/operator/runner/env.go @@ -153,7 +153,7 @@ func linkEnviron(repo *core.Repository, build *core.Build, system *core.System) // regular expression to extract the pull request number // from the git ref (e.g. refs/pulls/{d}/head) -var re = regexp.MustCompile("\\d+") +var re = regexp.MustCompile(`\d+`) // helper function combines one or more maps of environment // variables into a single map. diff --git a/store/build/build.go b/store/build/build.go index 0f4869ba5b..5f57a2694d 100644 --- a/store/build/build.go +++ b/store/build/build.go @@ -26,7 +26,7 @@ import ( // regular expression to extract the pull request number // from the git ref (e.g. refs/pulls/{d}/head) -var pr = regexp.MustCompile("\\d+") +var pr = regexp.MustCompile(`\d+`) // New returns a new Buildcore. func New(db *db.DB) core.BuildStore {