Skip to content

Commit 0434746

Browse files
authored
Merge pull request #60 from codecrafters-io/Update-go-version-to-1.21
CC-875 update go to 1.21
2 parents 472192c + 8ff338e commit 0434746

File tree

4 files changed

+25
-6
lines changed

4 files changed

+25
-6
lines changed

compiled_starters/go/codecrafters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ debug: false
77
# Use this to change the Go version used to run your code
88
# on Codecrafters.
99
#
10-
# Available versions: go-1.19
11-
language_pack: go-1.19
10+
# Available versions: go-1.21
11+
language_pack: go-1.21

dockerfiles/go-1.21.Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM golang:1.19-alpine
2+
3+
COPY go.mod /app/go.mod
4+
COPY go.sum /app/go.sum
5+
6+
WORKDIR /app
7+
8+
RUN go mod download
9+
10+
# Starting from Go 1.20, the go standard library is no loger compiled
11+
# setting the GODEBUG environment to "installgoroot=all" restores the old behavior
12+
RUN GODEBUG="installgoroot=all" go install std
13+
14+
# Even though modules are downloaded, building them could take a while.
15+
# Let's run go get on each module so that they're built ahead of time.
16+
# Ref: https://github.com/montanaflynn/golang-docker-cache
17+
RUN ash -c "set -exo pipefail; go mod graph | awk '{if (\$1 !~ \"@\") {print \$2}}' | xargs -r go get"
18+
19+
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="go.mod,go.sum"

solutions/go/01-init/code/codecrafters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ debug: false
77
# Use this to change the Go version used to run your code
88
# on Codecrafters.
99
#
10-
# Available versions: go-1.19
11-
language_pack: go-1.19
10+
# Available versions: go-1.21
11+
language_pack: go-1.21

starter_templates/codecrafters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ language_pack: python-3.12
1616
language_pack: swift-5.7
1717
{{/ language_is_swift }}
1818
{{# language_is_go }}
19-
# Available versions: go-1.19
20-
language_pack: go-1.19
19+
# Available versions: go-1.21
20+
language_pack: go-1.21
2121
{{/ language_is_go }}
2222
{{# language_is_php }}
2323
# Available versions: php-7.4

0 commit comments

Comments
 (0)