Upgrade to Go 1.27

Closes #15228
This commit is contained in:
Bjørn Erik Pedersen
2026-08-20 11:26:34 +02:00
parent 87260e4a60
commit b9f6c31979
4 changed files with 24 additions and 9 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ parameters:
defaults: &defaults
resource_class: large
docker:
- image: bepsays/ci-hugoreleaser:1.22600.20500
- image: bepsays/ci-hugoreleaser:1.22700.20000
environment: &buildenv
GOMODCACHE: /root/project/gomodcache
version: 2
@@ -58,7 +58,7 @@ jobs:
environment:
<<: [*buildenv]
docker:
- image: bepsays/ci-hugoreleaser-linux-arm64:1.22600.20500
- image: bepsays/ci-hugoreleaser-linux-arm64:1.22700.20000
steps:
- *restore-cache
- &attach-workspace
+1 -1
View File
@@ -16,7 +16,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.26.x]
go-version: [1.27.x]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
+1 -1
View File
@@ -186,4 +186,4 @@ require (
software.sslmate.com/src/go-pkcs12 v0.7.0 // indirect
)
go 1.26.0
go 1.27.0
+20 -5
View File
@@ -15,8 +15,16 @@ import (
)
func main() {
// The current is built with 2dc996f71b0ebafb77e64433e58333e049488a3c go1.26.3
// TODO(bep) preserve the staticcheck.conf file.
/*
Previously: with 2dc996f71b0ebafb77e64433e58333e049488a3c go1.26.3
Current: 8af21751f0 [release-branch.go1.27] go1.27.0
Note that the upgrade here is mostly automatic, but there are some manual steps:
* There's some unrelevant test codes that depends on some some internals in Go: Remove or stub these out to make it build.
* There's one failing test case as we have slightly cbhanged the meaning of isTrue.
* We're only patching the execution part of the template packages, so it's also good to check the execution package's Git history to check for valuable changes in our patched files.
*/
fmt.Println("Forking ...")
defer fmt.Println("Done ...")
@@ -37,7 +45,6 @@ func main() {
}
const (
// TODO(bep)
goSource = "/Users/bep/dev/go/misc/go/src"
forkRoot = "../../tpl/internal/go_templates"
)
@@ -140,10 +147,18 @@ var fs = afero.NewOsFs()
// Removes all non-Hugo files in the go_templates folder.
func cleanFork() {
keepRe := regexp.MustCompile(`(?i)hugo|staticcheck\.conf`)
must(filepath.Walk(filepath.Join(forkRoot), func(path string, info os.FileInfo, err error) error {
if !info.IsDir() && len(path) > 10 && !strings.Contains(path, "hugo") {
must(fs.Remove(path))
if info.IsDir() || len(path) <= 10 {
return nil
}
if keepRe.MatchString(info.Name()) {
return nil
}
must(fs.Remove(path))
return nil
}))
}