Skip to content

Commit d193f07

Browse files
authored
Merge pull request #125 from codecrafters-io/andy/upgrade
Upgrade Go to 1.24
2 parents ef28c1b + 40726ae commit d193f07

File tree

10 files changed

+37
-19
lines changed

10 files changed

+37
-19
lines changed

compiled_starters/go/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Time to move on to the next stage!
2929

3030
Note: This section is for stages 2 and beyond.
3131

32-
1. Ensure you have `go (1.16+)` installed locally
32+
1. Ensure you have `go (1.24)` installed locally
3333
1. Run `./your_program.sh` to run your program, which is implemented in
3434
`app/main.go`.
3535
1. Commit your changes and run `git push origin master` to submit your solution

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.22
11-
language_pack: go-1.22
10+
# Available versions: go-1.24
11+
language_pack: go-1.24

compiled_starters/go/go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
// DON'T EDIT THIS!
88

9-
module github/com/codecrafters-io/sqlite-starter-go
9+
module github.com/codecrafters-io/sqlite-starter-go
1010

11-
go 1.22
11+
go 1.24.0
1212

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

dockerfiles/go-1.22.Dockerfile

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
# syntax=docker/dockerfile:1.7-labs
12
FROM golang:1.22-alpine
23

3-
COPY go.mod /app/go.mod
4-
COPY go.sum /app/go.sum
4+
# Ensures the container is re-built if go.mod or go.sum changes
5+
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="go.mod,go.sum"
56

67
WORKDIR /app
78

8-
# Starting from Go 1.20, the go standard library is no loger compiled
9-
# setting the GODEBUG environment to "installgoroot=all" restores the old behavior
9+
# .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses
10+
COPY --exclude=.git --exclude=README.md . /app
11+
12+
# Starting from Go 1.20, the go standard library is no loger compiled.
13+
# Setting GODEBUG to "installgoroot=all" restores the old behavior
1014
RUN GODEBUG="installgoroot=all" go install std
1115

1216
RUN go mod download
13-
14-
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="go.mod,go.sum"

dockerfiles/go-1.24.Dockerfile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# syntax=docker/dockerfile:1.7-labs
2+
FROM golang:1.24-alpine
3+
4+
# Ensures the container is re-built if go.mod or go.sum changes
5+
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="go.mod,go.sum"
6+
7+
WORKDIR /app
8+
9+
# .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses
10+
COPY --exclude=.git --exclude=README.md . /app
11+
12+
# Starting from Go 1.20, the go standard library is no loger compiled.
13+
# Setting GODEBUG to "installgoroot=all" restores the old behavior
14+
RUN GODEBUG="installgoroot=all" go install std
15+
16+
RUN go mod download

solutions/go/01-dr6/code/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Time to move on to the next stage!
2929

3030
Note: This section is for stages 2 and beyond.
3131

32-
1. Ensure you have `go (1.16+)` installed locally
32+
1. Ensure you have `go (1.24)` installed locally
3333
1. Run `./your_program.sh` to run your program, which is implemented in
3434
`app/main.go`.
3535
1. Commit your changes and run `git push origin master` to submit your solution

solutions/go/01-dr6/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.22
11-
language_pack: go-1.22
10+
# Available versions: go-1.24
11+
language_pack: go-1.24

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
// DON'T EDIT THIS!
88

9-
module github/com/codecrafters-io/sqlite-starter-go
9+
module github.com/codecrafters-io/sqlite-starter-go
1010

11-
go 1.22
11+
go 1.24.0
1212

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

starter_templates/go/code/go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
// DON'T EDIT THIS!
88

9-
module github/com/codecrafters-io/sqlite-starter-go
9+
module github.com/codecrafters-io/sqlite-starter-go
1010

11-
go 1.22
11+
go 1.24.0
1212

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

starter_templates/go/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
attributes:
2-
required_executable: go (1.16+)
2+
required_executable: go (1.24)
33
user_editable_file: app/main.go

0 commit comments

Comments
 (0)