Skip to content

Commit

Permalink
Merge pull request #59 from codecrafters-io/go1.22
Browse files Browse the repository at this point in the history
CC-1121: Go 1.22 upgrade
  • Loading branch information
ryan-gang authored Apr 9, 2024
2 parents 1678a22 + 43f25fd commit e910836
Show file tree
Hide file tree
Showing 7 changed files with 22 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/grep-starter-go

go 1.16
go 1.22
13 changes: 13 additions & 0 deletions dockerfiles/go-1.22.Dockerfile
Original file line number Diff line number Diff line change
@@ -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"
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/grep-starter-go

go 1.16
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.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
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/grep-starter-go

go 1.16
go 1.22

0 comments on commit e910836

Please sign in to comment.