Skip to content

Commit 2af0418

Browse files
committed
Update Go starter template to version 1.24
- Migrate Go starter template from version 1.22 to 1.24 - Rename `app/server.go` to `app/main.go` in multiple locations - Update Dockerfiles and configuration files to support Go 1.24 - Adjust README and explanation files to reflect new Go version and file structure
1 parent acc6743 commit 2af0418

File tree

15 files changed

+38
-19
lines changed

15 files changed

+38
-19
lines changed

compiled_starters/go/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ and more.
1616

1717
# Passing the first stage
1818

19-
The entry point for your HTTP server implementation is in `app/server.go`. Study
19+
The entry point for your HTTP server implementation is in `app/main.go`. Study
2020
and uncomment the relevant code, and push your changes to pass the first stage:
2121

2222
```sh
@@ -30,8 +30,8 @@ Time to move on to the next stage!
3030

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

33-
1. Ensure you have `go (1.19)` installed locally
33+
1. Ensure you have `go (1.24)` installed locally
3434
1. Run `./your_program.sh` to run your program, which is implemented in
35-
`app/server.go`.
35+
`app/main.go`.
3636
1. Commit your changes and run `git push origin master` to submit your solution
3737
to CodeCrafters. Test output will be streamed to your terminal.
File renamed without changes.

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

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

99
module github.com/codecrafters-io/http-server-starter-go
1010

11-
go 1.22
11+
go 1.24.0

dockerfiles/go-1.22.Dockerfile

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

4+
# Ensures the container is re-built if go.mod or go.sum changes
35
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="go.mod,go.sum"
46

57
WORKDIR /app
68

7-
COPY go.mod go.sum ./
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
811

9-
# Starting from Go 1.20, the go standard library is no loger compiled
10-
# setting the GODEBUG environment to "installgoroot=all" restores the old behavior
12+
# Starting from Go 1.20, the go standard library is no loger compiled.
13+
# Setting GODEBUG to "installgoroot=all" restores the old behavior
1114
RUN GODEBUG="installgoroot=all" go install std
1215

1316
RUN go mod download

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-at4/code/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ and more.
1616

1717
# Passing the first stage
1818

19-
The entry point for your HTTP server implementation is in `app/server.go`. Study
19+
The entry point for your HTTP server implementation is in `app/main.go`. Study
2020
and uncomment the relevant code, and push your changes to pass the first stage:
2121

2222
```sh
@@ -30,8 +30,8 @@ Time to move on to the next stage!
3030

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

33-
1. Ensure you have `go (1.19)` installed locally
33+
1. Ensure you have `go (1.24)` installed locally
3434
1. Run `./your_program.sh` to run your program, which is implemented in
35-
`app/server.go`.
35+
`app/main.go`.
3636
1. Commit your changes and run `git push origin master` to submit your solution
3737
to CodeCrafters. Test output will be streamed to your terminal.

solutions/go/01-at4/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-at4/code/go.mod

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

99
module github.com/codecrafters-io/http-server-starter-go
1010

11-
go 1.22
11+
go 1.24.0

solutions/go/01-at4/explanation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The entry point for your HTTP server implementation is in `app/server.go`.
1+
The entry point for your HTTP server implementation is in `app/main.go`.
22

33
Study and uncomment the relevant code:
44

starter_templates/go/code/go.mod

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

99
module github.com/codecrafters-io/http-server-starter-go
1010

11-
go 1.22
11+
go 1.24.0

starter_templates/go/config.yml

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

0 commit comments

Comments
 (0)