From 2abc7c4cc25749060ebc70dea529ab3f0baf991e Mon Sep 17 00:00:00 2001 From: Ryan Gang Date: Mon, 8 Apr 2024 13:50:44 +0530 Subject: [PATCH 1/2] CC-1121: Go 1.22 upgrade --- compiled_starters/go/codecrafters.yml | 4 ++-- dockerfiles/go-1.22.Dockerfile | 13 +++++++++++++ solutions/go/01-init/code/codecrafters.yml | 4 ++-- starter_templates/codecrafters.yml | 4 ++-- 4 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 dockerfiles/go-1.22.Dockerfile diff --git a/compiled_starters/go/codecrafters.yml b/compiled_starters/go/codecrafters.yml index f280601..77886cf 100644 --- a/compiled_starters/go/codecrafters.yml +++ b/compiled_starters/go/codecrafters.yml @@ -7,5 +7,5 @@ debug: false # Use this to change the Go version used to run your code # on Codecrafters. # -# Available versions: go-1.21 -language_pack: go-1.21 +# Available versions: go-1.22 +language_pack: go-1.22 diff --git a/dockerfiles/go-1.22.Dockerfile b/dockerfiles/go-1.22.Dockerfile new file mode 100644 index 0000000..ec4d2bd --- /dev/null +++ b/dockerfiles/go-1.22.Dockerfile @@ -0,0 +1,13 @@ +FROM golang:1.22-alpine + +ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="go.mod,go.sum" + +WORKDIR /app + +COPY go.mod go.sum ./ + +# Starting from Go 1.20, the go standard library is no loger compiled +# setting the GODEBUG environment to "installgoroot=all" restores the old behavior +RUN GODEBUG="installgoroot=all" go install std + +RUN ash -c "set -exo pipefail; go mod graph | awk '{if (\$1 !~ \"@\") {print \$2}}' | xargs -r go get" diff --git a/solutions/go/01-init/code/codecrafters.yml b/solutions/go/01-init/code/codecrafters.yml index f280601..77886cf 100644 --- a/solutions/go/01-init/code/codecrafters.yml +++ b/solutions/go/01-init/code/codecrafters.yml @@ -7,5 +7,5 @@ debug: false # Use this to change the Go version used to run your code # on Codecrafters. # -# Available versions: go-1.21 -language_pack: go-1.21 +# Available versions: go-1.22 +language_pack: go-1.22 diff --git a/starter_templates/codecrafters.yml b/starter_templates/codecrafters.yml index 9d6998a..4517604 100644 --- a/starter_templates/codecrafters.yml +++ b/starter_templates/codecrafters.yml @@ -16,8 +16,8 @@ language_pack: python-3.12 language_pack: swift-5.1 {{/ language_is_swift }} {{# language_is_go }} -# Available versions: go-1.21 -language_pack: go-1.21 +# Available versions: go-1.22 +language_pack: go-1.22 {{/ language_is_go }} {{# language_is_php }} # Available versions: php-7.4 From 43f25fda3fbe91c6a25702884d51e61cace45c05 Mon Sep 17 00:00:00 2001 From: Ryan Gang Date: Mon, 8 Apr 2024 14:12:50 +0530 Subject: [PATCH 2/2] CC-1121: Upgrade go.mod files --- compiled_starters/go/go.mod | 2 +- solutions/go/01-init/code/go.mod | 2 +- starter_templates/go/go.mod | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiled_starters/go/go.mod b/compiled_starters/go/go.mod index db37c8d..0c2cece 100644 --- a/compiled_starters/go/go.mod +++ b/compiled_starters/go/go.mod @@ -8,4 +8,4 @@ module github.com/codecrafters-io/grep-starter-go -go 1.16 +go 1.22 diff --git a/solutions/go/01-init/code/go.mod b/solutions/go/01-init/code/go.mod index db37c8d..0c2cece 100644 --- a/solutions/go/01-init/code/go.mod +++ b/solutions/go/01-init/code/go.mod @@ -8,4 +8,4 @@ module github.com/codecrafters-io/grep-starter-go -go 1.16 +go 1.22 diff --git a/starter_templates/go/go.mod b/starter_templates/go/go.mod index db37c8d..0c2cece 100644 --- a/starter_templates/go/go.mod +++ b/starter_templates/go/go.mod @@ -8,4 +8,4 @@ module github.com/codecrafters-io/grep-starter-go -go 1.16 +go 1.22