Skip to content

Commit 2168c5b

Browse files
committed
Upgrade to Go 1.23
Fixes #12763
1 parent b3ad58f commit 2168c5b

File tree

34 files changed

+616
-402
lines changed

34 files changed

+616
-402
lines changed

‎.circleci/config.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ parameters:
44
defaults: &defaults
55
resource_class: large
66
docker:
7-
- image: bepsays/ci-hugoreleaser:1.22200.20501
7+
- image: bepsays/ci-hugoreleaser:1.22300.20000
88
environment: &buildenv
99
GOMODCACHE: /root/project/gomodcache
1010
version: 2
@@ -60,7 +60,7 @@ jobs:
6060
environment:
6161
<<: [*buildenv]
6262
docker:
63-
- image: bepsays/ci-hugoreleaser-linux-arm64:1.22200.20501
63+
- image: bepsays/ci-hugoreleaser-linux-arm64:1.22300.20000
6464
steps:
6565
- *restore-cache
6666
- &attach-workspace

‎.github/workflows/test.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
test:
1717
strategy:
1818
matrix:
19-
go-version: [1.21.x, 1.22.x]
19+
go-version: [1.22.x, 1.23.x]
2020
os: [ubuntu-latest, macos-latest, windows-latest]
2121
runs-on: ${{ matrix.os }}
2222
steps:

‎go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,4 +170,4 @@ require (
170170
software.sslmate.com/src/go-pkcs12 v0.2.0 // indirect
171171
)
172172

173-
go 1.21.8
173+
go 1.22.6

‎hugofs/fs.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ func isWrite(flag int) bool {
147147
// TODO(bep) move this to a more suitable place.
148148
func MakeReadableAndRemoveAllModulePkgDir(fs afero.Fs, dir string) (int, error) {
149149
// Safe guard
150-
if !strings.Contains(dir, "pkg") {
150+
// Note that the base directory changed from pkg to gomod_cache in Go 1.23.
151+
if !strings.Contains(dir, "pkg") && !strings.Contains(dir, "gomod") {
151152
panic(fmt.Sprint("invalid dir:", dir))
152153
}
153154

‎modules/client.go‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -365,18 +365,6 @@ func (c *Client) Get(args ...string) error {
365365
}
366366

367367
func (c *Client) get(args ...string) error {
368-
var hasD bool
369-
for _, arg := range args {
370-
if arg == "-d" {
371-
hasD = true
372-
break
373-
}
374-
}
375-
if !hasD {
376-
// go get without the -d flag does not make sense to us, as
377-
// it will try to build and install go packages.
378-
args = append([]string{"-d"}, args...)
379-
}
380368
if err := c.runGo(context.Background(), c.logger.Out(), append([]string{"get"}, args...)...); err != nil {
381369
return fmt.Errorf("failed to get %q: %w", args, err)
382370
}

‎scripts/fork_go_templates/main.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
)
1717

1818
func main() {
19-
// The current is built with 8e1fdea8316d840fd07e9d6e026048e53290948b go1.22.5
19+
// The current is built with 6885bad7dd86880be6929c02085e5c7a67ff2887 go1.23.0
2020
// TODO(bep) preserve the staticcheck.conf file.
2121
fmt.Println("Forking ...")
2222
defer fmt.Println("Done ...")

‎testscripts/commands/mod.txt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ hugo mod clean
1818
! stderr .
1919
stdout 'hugo: removed 1 dirs in module cache for \"github.com/bep/empty-hugo-module\"'
2020
hugo mod clean --all
21-
stdout 'Deleted 2\d{2} files from module cache\.'
21+
# Currently this is 299 on MacOS and 301 on Linux.
22+
stdout 'Deleted (2|3)\d{2} files from module cache\.'
2223
cd submod
2324
hugo mod init testsubmod
2425
cmpenv go.mod $WORK/golden/go.mod.testsubmod

‎testscripts/commands/mod_npm.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
dostounix golden/package.json
44

5+
56
hugo mod npm pack
67
cmp package.json golden/package.json
78

@@ -41,3 +42,4 @@ path="github.com/gohugoio/hugoTestModule2"
4142
}
4243
-- go.mod --
4344
module github.com/gohugoio/hugoTestModule
45+
go 1.20

‎testscripts/commands/mod_npm_withexisting.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ path="github.com/gohugoio/hugoTestModule2"
5555
}
5656
-- go.mod --
5757
module github.com/gohugoio/hugoTestModule
58+
go 1.20

‎tpl/internal/go_templates/cfg/cfg.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const KnownEnv = `
3636
GOAMD64
3737
GOARCH
3838
GOARM
39+
GOARM64
3940
GOBIN
4041
GOCACHE
4142
GOCACHEPROG
@@ -57,6 +58,7 @@ const KnownEnv = `
5758
GOPPC64
5859
GOPRIVATE
5960
GOPROXY
61+
GORISCV64
6062
GOROOT
6163
GOSUMDB
6264
GOTMPDIR

0 commit comments

Comments
 (0)