Skip to content

Commit

Permalink
CC-1121: Go 1.22 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-gang committed Apr 8, 2024
1 parent d0c2fe2 commit 138775c
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 9 deletions.
4 changes: 2 additions & 2 deletions compiled_starters/go/codecrafters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion compiled_starters/go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

module github.com/codecrafters-io/docker-starter-go

go 1.19
go 1.22
20 changes: 20 additions & 0 deletions dockerfiles/go-1.22.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM golang:1.22-alpine

RUN apk add --no-cache 'curl>=7.66'

# Download docker-explorer
ARG docker_explorer_version=v18
RUN curl --fail -Lo /usr/local/bin/docker-explorer https://github.com/codecrafters-io/docker-explorer/releases/download/${docker_explorer_version}/${docker_explorer_version}_linux_amd64
RUN chmod +x /usr/local/bin/docker-explorer

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"
4 changes: 2 additions & 2 deletions solutions/go/01-init/code/codecrafters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion solutions/go/01-init/code/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

module github.com/codecrafters-io/docker-starter-go

go 1.19
go 1.22
4 changes: 2 additions & 2 deletions starter_templates/codecrafters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ language_pack: python-3.12
language_pack: swift-5.6
{{/ 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
Expand Down
2 changes: 1 addition & 1 deletion starter_templates/go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

module github.com/codecrafters-io/docker-starter-go

go 1.19
go 1.22

0 comments on commit 138775c

Please sign in to comment.