Skip to content

Commit

Permalink
Added support for go 1.21.0 and set it to be default. (#167)
Browse files Browse the repository at this point in the history
* Added support for go 1.21.0 and set it to be default.

* bumped minor versions

* Update builder/go_versions.go

Co-authored-by: Andrew Gouin <[email protected]>

* Update builder/go_versions.go

Co-authored-by: Andrew Gouin <[email protected]>

---------

Co-authored-by: Andrew Gouin <[email protected]>
  • Loading branch information
danbryan and agouin authored Aug 31, 2023
1 parent 7d95b96 commit 763678f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 7 additions & 4 deletions builder/go_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import (

const (
Go118Version = "1.18.10"
Go119Version = "1.19.6"
Go120Version = "1.20.1"
Go119Version = "1.19.12"
Go120Version = "1.20.7"
Go121Version = "1.21.0"
// ADD NEW GO VERSION [1] - latest patch release for each major/minor

// When updating alpine image, ensure all golang build image combinations below exist
Expand All @@ -22,11 +23,12 @@ const (
Go118Image = Go118Version + "-alpine" + AlpineImageVersion
Go119Image = Go119Version + "-alpine" + AlpineImageVersion
Go120Image = Go120Version + "-alpine" + AlpineImageVersion
Go121Image = Go121Version + "-alpine" + AlpineImageVersion
// ADD NEW GO VERSION [2]

// ADD NEW GO VERSION [3] - update GoDefaultVersion and GoDefaultImage to latest
GoDefaultVersion = Go120Version
GoDefaultImage = Go120Image // default image for cosmos go builds if go.mod parse fails
GoDefaultVersion = Go121Version
GoDefaultImage = Go121Image // default image for cosmos go builds if go.mod parse fails
)

type GoVersion struct {
Expand All @@ -39,6 +41,7 @@ var GoImageForVersion = map[string]GoVersion{
"1.18": GoVersion{Version: Go118Version, Image: Go118Image},
"1.19": GoVersion{Version: Go119Version, Image: Go119Image},
"1.20": GoVersion{Version: Go120Version, Image: Go120Image},
"1.21": GoVersion{Version: Go121Version, Image: Go121Image},
// ADD NEW GO VERSION [4]
}

Expand Down
4 changes: 4 additions & 0 deletions builder/go_versions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ func TestGoVersions(t *testing.T) {
require.Equal(t, builder.Go120Image, goVer.Image)
require.Equal(t, builder.Go120Version, goVer.Version)

goVer = builder.GetImageAndVersionForGoVersion("1.21")
require.Equal(t, builder.Go121Image, goVer.Image)
require.Equal(t, builder.Go121Version, goVer.Version)

goVer = builder.GetImageAndVersionForGoVersion("unknown")
require.Equal(t, builder.GoDefaultImage, goVer.Image)
require.Equal(t, builder.GoDefaultVersion, goVer.Version)
Expand Down

0 comments on commit 763678f

Please sign in to comment.