Repository: zeromicro/go-zero
Pull request #3677 (2023-10-28 07:35:38)

chore: upgrade go to 1.19
Replace remaining go 1.18 references by 1.19, and update GitHub actions.
goleak cannot be upgraded because go 1.19 is too old.

reneleonhardt: Are there reasons not to update to go 1.21?
The goctl Dockerfile is already using it, if you would push a new image to Docker Hub your users wouldn't need to worry anymore about 1 critical, 10 high and 12 medium CVEs :)
kevwan: goleak requires go 1.20+
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/zeromicro/go-zero/pull/3677?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=zeromicro) Report
> Merging [#3677](https://app.codecov.io/gh/zeromicro/go-zero/pull/3677?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=zeromicro) (24493da) into [master](https://app.codecov.io/gh/zeromicro/go-zero/commit/32600f2619684a2a67ca6ce0e4085cbb27021d85?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=zeromicro) (32600f2) will **increase** coverage by `0.01%`.
> The diff coverage is `n/a`.


[see 1 file with indirect coverage changes](https://app.codecov.io/gh/zeromicro/go-zero/pull/3677/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=zeromicro)


Patch:
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 43447473..2b1ec376 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -35,7 +35,7 @@ jobs:
 
     steps:
     - name: Checkout repository
-      uses: actions/checkout@v3
+      uses: actions/checkout@v4
 
     # Initializes the CodeQL tools for scanning.
     - name: Initialize CodeQL
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index 88b17aaf..f3a3d561 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -12,10 +12,10 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - name: Check out code into the Go module directory
-        uses: actions/checkout@v3
+        uses: actions/checkout@v4
 
       - name: Set up Go 1.x
-        uses: actions/setup-go@v3
+        uses: actions/setup-go@v4
         with:
           go-version: 1.19
           check-latest: true
@@ -47,12 +47,12 @@ jobs:
     runs-on: windows-latest
     steps:
       - name: Checkout codebase
-        uses: actions/checkout@v3
+        uses: actions/checkout@v4
 
       - name: Set up Go 1.x
-        uses: actions/setup-go@v3
+        uses: actions/setup-go@v4
         with:
-          # use 1.18 to guarantee Go 1.18 compatibility
+          # use 1.19 to guarantee Go 1.19 compatibility
           go-version: 1.19
           check-latest: true
           cache: true
diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml
index 48c19053..b7727567 100644
--- a/.github/workflows/issues.yml
+++ b/.github/workflows/issues.yml
@@ -7,7 +7,7 @@ jobs:
   close-issues:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/stale@v6
+      - uses: actions/stale@v8
         with:
           days-before-issue-stale: 365
           days-before-issue-close: 90
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 4a0378d7..ff55c6eb 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -16,13 +16,13 @@ jobs:
           - goarch: "386"
             goos: darwin
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - uses: zeromicro/go-zero-release-action@master
         with:
           github_token: ${{ secrets.GITHUB_TOKEN }}
           goos: ${{ matrix.goos }}
           goarch: ${{ matrix.goarch }}
-          goversion: "https://dl.google.com/go/go1.18.10.linux-amd64.tar.gz"
+          goversion: "https://dl.google.com/go/go1.19.13.linux-amd64.tar.gz"
           project_path: "tools/goctl"
           binary_name: "goctl"
           extra_files: tools/goctl/readme.md tools/goctl/readme-cn.md
\ No newline at end of file
diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml
index 415b567e..7620592d 100644
--- a/.github/workflows/reviewdog.yml
+++ b/.github/workflows/reviewdog.yml
@@ -5,7 +5,7 @@ jobs:
     name: runner / staticcheck
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - uses: reviewdog/action-staticcheck@v1
         with:
           github_token: ${{ secrets.github_token }}
diff --git a/tools/goctl/go.mod b/tools/goctl/go.mod
index 0d61c9d0..e3b2ba85 100644
--- a/tools/goctl/go.mod
+++ b/tools/goctl/go.mod
@@ -1,6 +1,6 @@
 module github.com/zeromicro/go-zero/tools/goctl
 
-go 1.18
+go 1.19
 
 require (
 	github.com/DATA-DOG/go-sqlmock v1.5.0


Test patch:
diff --git a/core/stringx/replacer_fuzz_test.go b/core/stringx/replacer_fuzz_test.go
index da81ad9c..ad67ca82 100644
--- a/core/stringx/replacer_fuzz_test.go
+++ b/core/stringx/replacer_fuzz_test.go
@@ -1,4 +1,4 @@
-//go:build go1.18
+//go:build go1.19
 
 package stringx
 
diff --git a/tools/goctl/test/integration/model/mongo/Dockerfile b/tools/goctl/test/integration/model/mongo/Dockerfile
index 4116de77..91bce4fc 100644
--- a/tools/goctl/test/integration/model/mongo/Dockerfile
+++ b/tools/goctl/test/integration/model/mongo/Dockerfile
@@ -1,4 +1,4 @@
-FROM golang:1.18
+FROM golang:1.19
 
 ENV TZ Asia/Shanghai
 ENV GOPROXY https://goproxy.cn,direct
diff --git a/tools/goctl/util/ctx/gomod_test.go b/tools/goctl/util/ctx/gomod_test.go
index b8bc4612..39367422 100644
--- a/tools/goctl/util/ctx/gomod_test.go
+++ b/tools/goctl/util/ctx/gomod_test.go
@@ -81,13 +81,13 @@ func Test_getRealModule(t *testing.T) {
 						"Path":"foo",
 						"Dir":"/home/foo",
 						"GoMod":"/home/foo/go.mod",
-						"GoVersion":"go1.18"
+						"GoVersion":"go1.19"
 					}
 					{
 						"Path":"bar",
 						"Dir":"/home/bar",
 						"GoMod":"/home/bar/go.mod",
-						"GoVersion":"go1.18"
+						"GoVersion":"go1.19"
 					}`, nil
 				},
 			},
@@ -95,7 +95,7 @@ func Test_getRealModule(t *testing.T) {
 				Path:      "bar",
 				Dir:       "/home/bar",
 				GoMod:     "/home/bar/go.mod",
-				GoVersion: "go1.18",
+				GoVersion: "go1.19",
 			},
 		},
 	}
@@ -143,26 +143,26 @@ func TestDecodePackages(t *testing.T) {
 						"Path":"foo",
 						"Dir":"/home/foo",
 						"GoMod":"/home/foo/go.mod",
-						"GoVersion":"go1.18"
+						"GoVersion":"go1.19"
 					}
 					{
 						"Path":"bar",
 						"Dir":"/home/bar",
 						"GoMod":"/home/bar/go.mod",
-						"GoVersion":"go1.18"
+						"GoVersion":"go1.19"
 					}`),
 			want: []Module{
 				{
 					Path:      "foo",
 					Dir:       "/home/foo",
 					GoMod:     "/home/foo/go.mod",
-					GoVersion: "go1.18",
+					GoVersion: "go1.19",
 				},
 				{
 					Path:      "bar",
 					Dir:       "/home/bar",
 					GoMod:     "/home/bar/go.mod",
-					GoVersion: "go1.18",
+					GoVersion: "go1.19",
 				},
 			},
 		},
@@ -173,14 +173,14 @@ func TestDecodePackages(t *testing.T) {
 						"Path":"foo",
 						"Dir":"/home/foo",
 						"GoMod":"/home/foo/go.mod",
-						"GoVersion":"go1.18"
+						"GoVersion":"go1.19"
 					}`),
 			want: []Module{
 				{
 					Path:      "foo",
 					Dir:       "/home/foo",
 					GoMod:     "/home/foo/go.mod",
-					GoVersion: "go1.18",
+					GoVersion: "go1.19",
 				},
 			},
 		},