Update Go to 1.24 and use gotestsum#131
Conversation
WalkthroughThe README installation instructions were updated to require Go version 1.24 or later. Legacy installation steps for older Go versions were removed, leaving only the current recommended Changes
Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (3)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Summary of Changes
Hello @ReneWerner87, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request primarily focuses on modernizing the project's development environment by upgrading the Go language version to 1.24. Beyond this core version bump, the author intends to enhance the testing infrastructure by adopting gotestsum for more efficient test execution and to update the continuous integration linter workflows to be compatible with the new Go version.
Highlights
- Go Version Upgrade: The project's Go language version requirement is being updated from
1.21to1.24. This change is reflected in thego.modfile. - Testing Tool Integration: The pull request aims to integrate
gotestsumfor running tests, including enabling caching, to improve the overall testing workflow. (Note: The specific changes forgotestsumintegration are not present in the provided patch, but are stated in the PR description.) - CI/CD Linter Update: The linter workflow is intended to be updated to align with the new Go
1.24version. (Note: The specific changes for the linter workflow are not present in the provided patch, but are stated in the PR description.)
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request aims to update the Go version to 1.24 and introduce gotestsum. The provided changes only reflect the Go version bump in go.mod. The other changes mentioned in the description for gotestsum and the linter workflow appear to be missing.
My review includes a high-severity comment on the use of a future, unreleased Go version, which poses a risk to project stability and maintainability.
For a complete review, please include all relevant changes in the PR. The test failure you mentioned might be related to the missing CI configuration.
| module github.com/gofiber/cli | ||
|
|
||
| go 1.21 | ||
| go 1.24 |
There was a problem hiding this comment.
This change updates the project to require Go 1.24, which is a future, unreleased version. Depending on an unstable toolchain is risky as it can lead to unexpected build breakages and creates a higher barrier for contributors to set up their environment.
It is strongly recommended to use the latest stable Go version (e.g., 1.22) to maintain project stability. If this change is intentional and there's a strong reason to depend on a future version, it would be beneficial to document it in the project's contribution guidelines or README.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
.github/workflows/linter.ymlis excluded by!**/*.yml.github/workflows/test.ymlis excluded by!**/*.ymlgo.modis excluded by!**/*.mod
📒 Files selected for processing (1)
README.md(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: ReneWerner87
PR: gofiber/recipes#0
File: :0-0
Timestamp: 2024-11-26T20:05:15.793Z
Learning: For future contributions to the `gofiber/recipes` repository, ensure that the tasks outlined in `.github/CONTRIBUTING.md` are incorporated, including creating a new directory without a "fiber" prefix, adding a `README.md` with Docusaurus metadata, and updating the overview by running `make generate`.
Learnt from: juls0730
PR: gofiber/recipes#2710
File: tableflip/main.go:61-62
Timestamp: 2024-12-01T01:15:48.126Z
Learning: In the GoFiber `tableflip` recipe (`tableflip/main.go`), the implementation matches the upstream reference implementation. Future code suggestions should consider maintaining this alignment to ensure consistency.
Learnt from: ReneWerner87
PR: gofiber/fiber#3161
File: app.go:923-932
Timestamp: 2024-11-15T07:56:21.623Z
Learning: In the Fiber framework, breaking changes are acceptable when moving from version 2 to version 3, including modifications to method signatures such as in the `Test` method in `app.go`.
Learnt from: sixcolors
PR: gofiber/fiber#3016
File: middleware/session/store.go:164-167
Timestamp: 2024-10-02T23:03:31.727Z
Learning: Unit tests in this project use testify require.
Learnt from: sixcolors
PR: gofiber/fiber#3016
File: middleware/session/store.go:164-167
Timestamp: 2024-10-08T19:06:06.583Z
Learning: Unit tests in this project use testify require.
Learnt from: efectn
PR: gofiber/fiber#3162
File: hooks_test.go:228-228
Timestamp: 2024-12-13T08:14:22.851Z
Learning: In Go test files, prefer using the `require` methods from the `testify` package for assertions instead of manual comparisons and calls to `t.Fatal` or `t.Fatalf`.
README.md (3)
Learnt from: ReneWerner87
PR: gofiber/storage#0
File: :0-0
Timestamp: 2025-02-12T11:24:31.153Z
Learning: The storage package in gofiber/storage repository can be used independently of the Fiber web framework.
Learnt from: norri
PR: gofiber/recipes#2701
File: clean-code/app/server/server.go:14-16
Timestamp: 2024-11-23T19:50:41.765Z
Learning: In the `clean-code` example at `clean-code/app/server/server.go` using the Go Fiber framework, it's acceptable to omit production-level features like context usage and graceful shutdown handling to keep the example simple.
Learnt from: ReneWerner87
PR: gofiber/recipes#0
File: :0-0
Timestamp: 2024-11-26T20:05:15.793Z
Learning: For future contributions to the `gofiber/recipes` repository, ensure that the tasks outlined in `.github/CONTRIBUTING.md` are incorporated, including creating a new directory without a "fiber" prefix, adding a `README.md` with Docusaurus metadata, and updating the overview by running `make generate`.
🪛 GitHub Actions: Linter
README.md
[error] 1-1: Tar extraction failed: Cannot open file because it already exists.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Analyse
- GitHub Check: Build (1.24.x, windows-latest)
| # Installation | ||
| Requires Go 1.24 or later. | ||
|
|
||
| ```bash | ||
| # for go version since 1.16 | ||
| go install github.com/gofiber/cli/fiber@latest |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Verify feasibility of requiring Go 1.24 before the toolchain is publicly available
Go 1.24 is not released at the time of writing (latest stable is 1.22). Mandating it in the README may block new users who follow the instructions today.
Please double-check:
- Whether any source change truly needs Go 1.24 features.
- That
go.modhas been bumped togo 1.24for consistency. - CI matrices and Docker images support the new version.
If 1 and 2 are not strictly required yet, consider stating “Go ≥ 1.22 (tested with 1.24beta)” instead, or add a note that 1.24 is currently in beta.
🏁 Script executed:
#!/bin/bash
set -e
echo "Checking go.mod for Go version requirement:"
sed -n 's/^go //p' go.mod || echo "go.mod not found or no ‘go’ directive present."
echo ""
echo "Searching CI workflows for Go version usage with setup-go:"
grep -R "uses: .*actions/setup-go" -n .github/workflows || echo "No setup-go usage found in .github/workflows."
echo ""
echo "Scanning Dockerfile(s) for Go version in base image:"
grep -R "^FROM.*golang" -n . || echo "No Dockerfile with golang base image found."Length of output: 888
🏁 Script executed:
#!/bin/bash
set -e
echo "Locating go.mod in the repository:"
find . -type f -name go.mod || echo "No go.mod file found."
echo ""
echo "Locating GitHub Actions workflows:"
find .github/workflows -type f -name '*.yml' -o -name '*.yaml' 2>/dev/null || echo "No workflow files found under .github/workflows."
echo ""
echo "Searching for setup-go usage across repository:"
grep -R "actions/setup-go" -n . || echo "No setup-go references found."
echo ""
echo "Locating Dockerfile(s) in the repository:"
find . -type f -iname 'Dockerfile*' || echo "No Dockerfile(s) found."Length of output: 738
🏁 Script executed:
#!/bin/bash
set -e
echo "Fetching go.mod from gofiber/cli repository and extracting Go version requirement:"
curl -sSL https://raw.githubusercontent.com/gofiber/cli/main/go.mod | sed -n 's/^go //p' || echo "Failed to fetch or parse go.mod"Length of output: 274
🏁 Script executed:
#!/bin/bash
set -e
echo "Checking 'go' directive in remote go.mod (master branch):"
curl -sSL https://raw.githubusercontent.com/gofiber/cli/master/go.mod | grep '^go ' || echo "No 'go' directive found in remote go.mod"Length of output: 233
Align Go version requirement in README with codebase
The README now states “Requires Go 1.24 or later,” but the project’s remote go.mod is still set to go 1.21, and there are no CI workflows or Dockerfiles testing Go 1.24. Please:
- Verify whether any new changes actually depend on Go 1.24 language or stdlib features.
- If Go 1.24 is required:
- Bump the
godirective in go.mod to1.24. - Add or update CI (e.g., GitHub Actions
setup-go) to include Go 1.24. - Ensure any Dockerfiles use a Go 1.24 base image.
- Bump the
- Otherwise, adjust the README to reflect the current minimum supported version. For example:
- Requires Go 1.24 or later. + Requires Go ≥ 1.21 (tested with Go 1.24 beta).
This will keep documentation, module settings, and CI in sync.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Installation | |
| Requires Go 1.24 or later. | |
| ```bash | |
| # for go version since 1.16 | |
| go install github.com/gofiber/cli/fiber@latest | |
| # Installation | |
| - Requires Go 1.24 or later. | |
| + Requires Go ≥ 1.21 (tested with Go 1.24 beta). | |
🤖 Prompt for AI Agents
In README.md lines 6 to 10, the stated Go version requirement (1.24) is
inconsistent with the go.mod file and CI configurations that currently use Go
1.21. Verify if any code changes require Go 1.24 features; if so, update the
go.mod 'go' directive to 1.24, modify CI workflows to test with Go 1.24, and
update Dockerfiles to use a Go 1.24 base image. If not, change the README to
reflect the current minimum Go version (1.21) to keep documentation, module
settings, and CI aligned.
Summary
Testing
go install gotest.tools/gotestsum@latest$(go env GOPATH)/bin/gotestsum --format standard-verbose -- -race ./...(fails: Forbidden)https://chatgpt.com/codex/tasks/task_e_686ed0afed4483268b6ae99aba7cba7c
Summary by CodeRabbit