Skip to content

Commit 1ce21cf

Browse files
authored
Merge pull request goretk#71 from goretk/update/add-go-1-21
Add new compiler versions
2 parents 8de0e40 + 705ec7a commit 1ce21cf

File tree

10 files changed

+106
-25
lines changed

10 files changed

+106
-25
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"name": "Go",
55
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/go:0-1.20"
6+
"image": "mcr.microsoft.com/devcontainers/go:1.21-bullseye"
77

88
// Features to add to the dev container. More info: https://containers.dev/features.
99
// "features": {},

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Go
1919
uses: actions/setup-go@v4
2020
with:
21-
go-version: ">=1.20.0"
21+
go-version: ">=1.21.0"
2222

2323
- name: Build
2424
run: go build -o a

file_test.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"os"
2525
"os/exec"
2626
"path/filepath"
27+
"strconv"
2728
"strings"
2829
"testing"
2930

@@ -76,6 +77,13 @@ func TestGoldFiles(t *testing.T) {
7677
t.Skip("No golden files")
7778
}
7879

80+
mustParse := func(n int, e error) int {
81+
if err != nil {
82+
t.Fatalf("parsing error: %s", err)
83+
}
84+
return n
85+
}
86+
7987
for _, file := range goldFiles {
8088
t.Run("compiler_version_"+file, func(t *testing.T) {
8189
assert := assert.New(t)
@@ -96,10 +104,12 @@ func TestGoldFiles(t *testing.T) {
96104
// Get info from filename gold-os-arch-goversion
97105
fileInfo := strings.Split(file, "-")
98106

99-
// If patch level is 0, it is dropped. For example. 10.0.0 is 10.0
107+
// If patch level is 0, it is dropped. For example. 10.0.0 is 10.0.
108+
// This was changed in 1.21 so if the version is 1.21 or greater, we take
109+
// the whole string.
100110
var actualVersion string
101111
verArr := strings.Split(fileInfo[3], ".")
102-
if len(verArr) == 3 && verArr[2] == "0" {
112+
if len(verArr) == 3 && verArr[2] == "0" && mustParse(strconv.Atoi(verArr[1])) < 21 {
103113
actualVersion = strings.Join(verArr[:2], ".")
104114
} else {
105115
actualVersion = fileInfo[3]

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
module github.com/goretk/gore
22

3-
go 1.20
3+
go 1.21
44

55
require (
6-
github.com/stretchr/testify v1.7.1
7-
golang.org/x/arch v0.0.0-20220412001346-fc48f9fe4c15
8-
golang.org/x/mod v0.5.1
6+
github.com/stretchr/testify v1.8.4
7+
golang.org/x/arch v0.6.0
8+
golang.org/x/mod v0.14.0
99
)
1010

1111
require (
1212
github.com/davecgh/go-spew v1.1.1 // indirect
1313
github.com/pmezard/go-difflib v1.0.0 // indirect
14-
gopkg.in/yaml.v3 v3.0.0-20220512140231-539c8e751b99 // indirect
14+
gopkg.in/yaml.v3 v3.0.1 // indirect
1515
)

go.sum

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
21
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
32
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
43
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
54
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
6-
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
7-
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
8-
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
9-
golang.org/x/arch v0.0.0-20220412001346-fc48f9fe4c15 h1:GVfVkciLYxn5mY5EncwAe0SXUn9Rm81rRkZ0TTmn/cU=
10-
golang.org/x/arch v0.0.0-20220412001346-fc48f9fe4c15/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
11-
golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38=
12-
golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
5+
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
6+
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
7+
golang.org/x/arch v0.6.0 h1:S0JTfE48HbRj80+4tbvZDYsJ3tGv6BUU3XxyZ7CirAc=
8+
golang.org/x/arch v0.6.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
9+
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
10+
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
1311
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
1412
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
15-
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
16-
gopkg.in/yaml.v3 v3.0.0-20220512140231-539c8e751b99 h1:dbuHpmKjkDzSOMKAWl10QNlgaZUd3V1q99xc81tt2Kc=
17-
gopkg.in/yaml.v3 v3.0.0-20220512140231-539c8e751b99/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
13+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
14+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

goversion_gen.go

Lines changed: 23 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/goversions.csv

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,33 @@
11
version,sha,date
2+
go1.21.4,ed817f1c4055a559a94afffecbb91c78e4f39942,2023-11-07T17:38:04Z
3+
go1.21.3,883f062fc0a097bf561030ad453fd3e300896975,2023-10-10T16:31:03Z
4+
go1.21.2,26b5783b72376acd0386f78295e678b9a6bff30e,2023-10-05T19:06:58Z
5+
go1.21.1,2c1e5b05fe39fc5e6c730dd60e82946b8e67c6ba,2023-09-06T15:31:51Z
6+
go1.21.0,c19c4c566c63818dfd059b352e52c4710eecf14d,2023-08-08T15:00:52Z
7+
go1.21rc4,041dd5ce051caf72d64b6d5f2f975515b3676a71,2023-08-02T13:51:49Z
8+
go1.21rc3,4aeac326b5cb41a24d6e48c01008abf2f0fda7ff,2023-07-14T15:07:26Z
9+
go1.21rc2,d8117459c513e048eb72f11988d5416110dff359,2023-06-21T15:40:05Z
10+
go1.21rc1,1c1c82432a78b06c8010c7257df58ff11cc05b61,2023-06-16T14:21:46Z
11+
go1.20.11,1d0d4b149ce71083ec474d0491851ab2d2dc695e,2023-11-07T17:55:05Z
12+
go1.20.10,8042fd87f37a725e34407994c9a11aaf95f5af45,2023-10-10T16:26:21Z
13+
go1.20.9,68f9a6e2addc828246992e66e79c6a51a32d1d71,2023-10-05T19:28:06Z
14+
go1.20.8,d5b851804329aa547dafa278a0c35dd62298d651,2023-09-06T15:31:47Z
15+
go1.20.7,adb775e309dea43157e931835e920ac9e7769abe,2023-08-01T19:34:15Z
16+
go1.20.6,2c358ffe9762ba08c8db0196942395f97775e31b,2023-07-11T15:58:20Z
17+
go1.20.5,e827d41c0a2ea392c117a790cdfed0022e419424,2023-06-06T17:39:34Z
18+
go1.20.4,324c3ace2d2e4e30949baa23b4c9aac8a4123317,2023-05-02T17:21:02Z
219
go1.20.3,7c47a6b15782b13ecb76fd3c6c18e5f1edc34733,2023-04-04T17:30:09Z
320
go1.20.2,aee9a19c559da6fd258a8609556d89f6fad2a6d8,2023-03-07T16:47:18Z
421
go1.20.1,202a1a57064127c3f19d96df57b9f9586145e21c,2023-02-14T18:12:19Z
522
go1.20,de4748c47c67392a57f250714509f590f68ad395,2023-02-01T19:03:46Z
623
go1.20rc3,b3160e8bcedb25c5266e047ada01b6f462521401,2023-01-12T17:16:08Z
724
go1.20rc2,32593a91927dbb891e00a5a94abb04105f6a8aa8,2023-01-04T16:02:35Z
825
go1.20rc1,9f0234214473dfb785a5ad84a8fc62a6a395cbc3,2022-12-07T22:00:46Z
26+
go1.19.13,619b8fd7d2c94af12933f409e962b99aa9263555,2023-09-06T15:37:56Z
27+
go1.19.12,0ae54ddd37302bdd2a8c775135bf5f076a18eeb3,2023-08-01T20:11:51Z
28+
go1.19.11,e58941fc25771784319ebd0178e566ecf7d3d8c1,2023-07-11T16:38:32Z
29+
go1.19.10,7fe60b5df764f5a16a2c40e4412b5ed60f709192,2023-06-06T17:46:04Z
30+
go1.19.9,484330d038d060c6e4db3dc8e6ea2b811b2a44d8,2023-05-02T17:21:05Z
931
go1.19.8,ca305e101d89969b5cc6a812b1f12038b769aaa2,2023-04-04T17:30:16Z
1032
go1.19.7,7bd22aafe41be40e2174335a3dc55431ca9548ec,2023-03-07T16:49:31Z
1133
go1.19.6,8656c03fee94ce9cdc4da120b831c2fb9fd68d9d,2023-02-14T18:09:51Z

stdpkg_gen.go

Lines changed: 32 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

testdata/build.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ var spec = []struct {
162162
{"1.18.0", []osarchTuple{{linux, []goarch{x86, amd64}}, {darwin, []goarch{arm64, amd64}}, {windows, []goarch{x86, amd64}}}},
163163
{"1.19.0", []osarchTuple{{linux, []goarch{x86, amd64}}, {darwin, []goarch{arm64, amd64}}, {windows, []goarch{x86, amd64}}}},
164164
{"1.20.0", []osarchTuple{{linux, []goarch{x86, amd64}}, {darwin, []goarch{arm64, amd64}}, {windows, []goarch{x86, amd64}}}},
165+
{"1.21.0", []osarchTuple{{linux, []goarch{x86, amd64}}, {darwin, []goarch{arm64, amd64}}, {windows, []goarch{x86, amd64}}}},
165166
}
166167

167168
const gofile = `package main

0 commit comments

Comments
 (0)