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/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/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/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/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 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