Skip to content

Commit e7a127b

Browse files
authored
Merge pull request #62 from codecrafters-io/go1.22
CC-1121: Go 1.22 upgrade
2 parents 99e8874 + 5ff1f2d commit e7a127b

File tree

7 files changed

+28
-9
lines changed

7 files changed

+28
-9
lines changed

compiled_starters/go/codecrafters.yml

+2-2
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.21
11-
language_pack: go-1.21
10+
# Available versions: go-1.22
11+
language_pack: go-1.22

compiled_starters/go/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
module github/com/codecrafters-io/sqlite-starter-go
1010

11-
go 1.19
11+
go 1.22
1212

1313
require github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2

dockerfiles/go-1.22.Dockerfile

+19
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

+2-2
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.21
11-
language_pack: go-1.21
10+
# Available versions: go-1.22
11+
language_pack: go-1.22

solutions/go/01-init/code/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
module github/com/codecrafters-io/sqlite-starter-go
1010

11-
go 1.19
11+
go 1.22
1212

1313
require github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2

starter_templates/codecrafters.yml

+2-2
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.21
20-
language_pack: go-1.21
19+
# Available versions: go-1.22
20+
language_pack: go-1.22
2121
{{/ language_is_go }}
2222
{{# language_is_php }}
2323
# Available versions: php-7.4

starter_templates/go/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
module github/com/codecrafters-io/sqlite-starter-go
1010

11-
go 1.19
11+
go 1.22
1212

1313
require github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2

0 commit comments

Comments
 (0)