-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🧹 v3 (chore): Bump minimum version of Go to 1.21 #2911
Conversation
WalkthroughThe updates across various files primarily focus on enhancing compatibility and code quality. This includes adjusting the Go version compatibility for the Fiber library, refining GitHub Actions workflows to use a more current Go version, and optimizing code by replacing custom functions with standard library functions in accordance with Go 1.20 standards. These changes collectively aim to improve the project's efficiency and maintainability. Changes
Related issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files ignored due to path filters (1)
go.mod
is excluded by:!**/*.mod
Files selected for processing (10)
- .github/README.md (3 hunks)
- .github/README_az.md (1 hunks)
- .github/README_es.md (1 hunks)
- .github/README_tr.md (1 hunks)
- .github/README_zh-CN.md (1 hunks)
- .github/README_zh-TW.md (1 hunks)
- .github/workflows/benchmark.yml (1 hunks)
- .github/workflows/linter.yml (1 hunks)
- .github/workflows/test.yml (1 hunks)
- middleware/pprof/pprof.go (2 hunks)
Files skipped from review due to trivial changes (2)
- .github/workflows/linter.yml
- .github/workflows/test.yml
Additional comments: 12
.github/workflows/benchmark.yml (1)
- 28-28: The update of the Go version from "1.20.x" to "1.21.x" in the GitHub Actions workflow is aligned with the PR's objective to bump the minimum Go version. This change ensures that the benchmark workflow uses the latest supported Go version, adhering to best practices for security and compatibility. Ensure that all other CI/CD workflows in the project are similarly updated to maintain consistency across the development environment.
middleware/pprof/pprof.go (1)
- 43-43: Replacing the custom
cutPrefix
function withstrings.CutPrefix
from Go's standard library is a good practice that simplifies the code and leverages standard library features. This change aligns with the PR's objective to update the codebase for Go 1.21 compatibility. Ensure thorough testing is conducted to verify that the new implementation behaves as expected, especially in edge cases that the custom function might have handled differently..github/README_zh-CN.md (1)
- 169-170: The documentation correctly highlights the limitations related to the use of
unsafe
features and the incompatibility withnet/http
interfaces. This is important for users to understand the constraints and make informed decisions when using Fiber..github/README_zh-TW.md (1)
- 176-176: The documentation correctly updates the Go version compatibility from 1.20-1.22 to 1.21-1.22. However, it's important to ensure that all references to Go versions throughout the project's documentation, code comments, and configuration files are consistent with this change to avoid confusion.
Please verify that all mentions of Go versions across the project align with this update.
.github/README_es.md (1)
- 163-163: The compatibility information update is clear and directly addresses the change in supported Go versions from 1.20-1.22 to 1.21-1.22. This change is essential for users to understand the current support and compatibility of the Fiber library with Go versions.
.github/README_tr.md (1)
- 163-164: The update to mention Fiber's testing with Go 1.21 and 1.22, as well as the compatibility issues due to Fiber's unsafe usage, is clear and informative. It's crucial to ensure that the translation accurately conveys these points to Turkish-speaking users.
.github/README.md (4)
- 139-139: The Go version requirement is updated to
1.21
. This is a crucial update for users and developers to ensure compatibility with the project's dependencies and features that leverage Go 1.21 enhancements.- 173-173: It's mentioned that Fiber uses
unsafe
, which may affect compatibility with future Go versions. This is an important note for developers considering long-term maintenance and compatibility.- 174-174: The note about Fiber not being compatible with
net/http
interfaces is significant. It directly impacts developers who might consider integrating Fiber with projects or libraries that rely on the standard Gonet/http
package. This limitation should be clearly understood to avoid integration issues.- 654-656: The external middleware section links to repositories like
contrib
,storage
, andtemplate
. It's good to see these resources being made available, as they can significantly enhance the functionality and flexibility of Fiber applications. However, it's essential for developers to review these middleware for security and performance implications in their specific use cases..github/README_az.md (2)
- 167-167: The update to specify Fiber's compatibility with Go 1.21 and 1.22 is clear and aligns with the PR objectives. This change helps ensure users are aware of the supported Go versions for Fiber 3.0.0.
- 167-168: The limitations section provides valuable information regarding Fiber's reliance on unsafe principles and its incompatibility with net/http interfaces. This transparency is beneficial for users to understand potential limitations when using Fiber with certain Go projects or libraries. It's important to ensure that such limitations are communicated clearly to prevent any confusion or issues during development.
以及在互联网上的所有诉求,为了创建一个能让有着任何技术栈的开发者都能在 deadline 前完成任务的**迅速**,**灵活**以及**友好**的 `Go web` 框架,就像 `Express` 在 `JavaScript` 世界中一样。 | ||
|
||
## ⚠️ 限制 | ||
* 由于 Fiber 使用了 unsafe 特性,导致其可能与最新的 Go 版本不兼容。Fiber 3.0.0 已经在 Go 1.20 到 1.22 上测试过。 | ||
* 由于 Fiber 使用了 unsafe 特性,导致其可能与最新的 Go 版本不兼容。Fiber 3.0.0 已经在 Go 1.21 到 1.22 上测试过。 | ||
* Fiber 与 net/http 接口不兼容。也就是说你无法直接使用例如 gqlen,go-swagger 或者任何其他属于 net/http 生态的项目。 | ||
|
||
## 👀 示例 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [104-104]
There's an extra space before the closing parenthesis in the Markdown link. This might not affect the rendering on all platforms, but it's cleaner to remove unnecessary spaces for consistency.
- 服务</b>,使<b>快速</b>开发更加简便。 </p>
+ 服务</b>,使<b>快速</b>开发更加简便。</p>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2911 +/- ##
==========================================
- Coverage 82.53% 82.52% -0.01%
==========================================
Files 116 116
Lines 8337 8333 -4
==========================================
- Hits 6881 6877 -4
Misses 1111 1111
Partials 345 345
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Bump Go minimum version to 1.21
Description
Bump the minimum Go version to 1.21. Remove support for go1.20 which is End of Life since last month as noted here: https://endoflife.date/go
Changes introduced
List the new features or adjustments introduced in this pull request. Provide details on benchmarks, documentation updates, changelog entries, and if applicable, the migration guide.
Type of change
Please delete options that are not relevant.
Summary by CodeRabbit
strings.CutPrefix
in the pprof middleware to align with Go 1.20 standards.