Skip to content

Commit

Permalink
refactor: Update Go starter template to use main.go instead of server.go
Browse files Browse the repository at this point in the history
  • Loading branch information
andy1li committed Feb 27, 2025
1 parent 063e2b1 commit 589804f
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 14 deletions.
4 changes: 2 additions & 2 deletions compiled_starters/go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ event loops, the Redis protocol and more.

# Passing the first stage

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

```sh
Expand All @@ -28,6 +28,6 @@ Note: This section is for stages 2 and beyond.

1. Ensure you have `go (1.24)` installed locally
1. Run `./your_program.sh` to run your Redis server, which is implemented in
`app/server.go`.
`app/main.go`.
1. Commit your changes and run `git push origin master` to submit your solution
to CodeCrafters. Test output will be streamed to your terminal.
File renamed without changes.
9 changes: 6 additions & 3 deletions dockerfiles/go-1.22.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# syntax=docker/dockerfile:1.7-labs
FROM golang:1.22-alpine

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

WORKDIR /app

COPY go.mod go.sum ./
# .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses
COPY --exclude=.git --exclude=README.md . /app

# Starting from Go 1.20, the go standard library is no loger compiled
# setting the GODEBUG environment to "installgoroot=all" restores the old behavior
# Starting from Go 1.20, the go standard library is no loger compiled.
# Setting GODEBUG to "installgoroot=all" restores the old behavior
RUN GODEBUG="installgoroot=all" go install std

RUN go mod download
9 changes: 6 additions & 3 deletions dockerfiles/go-1.24.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# syntax=docker/dockerfile:1.7-labs
FROM golang:1.24-alpine

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

WORKDIR /app

COPY go.mod go.sum ./
# .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses
COPY --exclude=.git --exclude=README.md . /app

# Starting from Go 1.20, the go standard library is no loger compiled
# setting the GODEBUG environment to "installgoroot=all" restores the old behavior
# Starting from Go 1.20, the go standard library is no loger compiled.
# Setting GODEBUG to "installgoroot=all" restores the old behavior
RUN GODEBUG="installgoroot=all" go install std

RUN go mod download
4 changes: 2 additions & 2 deletions solutions/go/01-jm1/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ event loops, the Redis protocol and more.

# Passing the first stage

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

```sh
Expand All @@ -28,6 +28,6 @@ Note: This section is for stages 2 and beyond.

1. Ensure you have `go (1.24)` installed locally
1. Run `./your_program.sh` to run your Redis server, which is implemented in
`app/server.go`.
`app/main.go`.
1. Commit your changes and run `git push origin master` to submit your solution
to CodeCrafters. Test output will be streamed to your terminal.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion solutions/go/01-jm1/explanation.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The entry point for your Redis implementation is in `app/server.go`.
The entry point for your Redis implementation is in `app/main.go`.

Study and uncomment the relevant code:

Expand Down
4 changes: 2 additions & 2 deletions solutions/go/02-rg2/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ event loops, the Redis protocol and more.

# Passing the first stage

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

```sh
Expand All @@ -28,6 +28,6 @@ Note: This section is for stages 2 and beyond.

1. Ensure you have `go (1.24)` installed locally
1. Run `./your_program.sh` to run your Redis server, which is implemented in
`app/server.go`.
`app/main.go`.
1. Commit your changes and run `git push origin master` to submit your solution
to CodeCrafters. Test output will be streamed to your terminal.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion starter_templates/go/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
attributes:
required_executable: go (1.24)
user_editable_file: app/server.go
user_editable_file: app/main.go

0 comments on commit 589804f

Please sign in to comment.