-
-
Notifications
You must be signed in to change notification settings - Fork 234
Update min Go version for tutorial #472
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
Conversation
With Go < 1.22 I get this error when running the tutorial: ``` ../../go/pkg/mod/github.com/danielgtaylor/huma/v2@v2.18.0/formdata.go:173:21: undefined: slices.Concat ``` I think slices.Concat is new in 1.22. With 1.22.4 the tutorial works fine. I am a tech writer by day, using Go at night to write tests of the docs that I write. I could be completely wrong about the need for 1.22, but here is my reference: https://blog.carlana.net/post/2024/golang-slices-concat/
WalkthroughThe recent update to the documentation for Huma's installation tutorial involves changing the required version of Go from 1.20 to 1.22. This ensures that users are informed of the latest necessary version for compatibility and optimal performance. Changes
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.
Actionable comments posted: 0
Outside diff range and nitpick comments (1)
docs/docs/tutorial/installation.md (1)
Line range hint
13-13: Fix grammar in the installation instructions.- then go get the Huma dependency to it's ready to be imported: + then go get the Huma dependency so it's ready to be imported:This correction improves the readability and correctness of the installation instructions.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- docs/docs/tutorial/installation.md (1 hunks)
Additional context used
LanguageTool
docs/docs/tutorial/installation.md
[uncategorized] ~13-~13: The preposition ‘as’ seems more likely in this position. (AI_HYDRA_LEO_REPLACE_TO_AS)
Context: ...roject, then go get the Huma dependency to it's ready to be imported: {{ asciinem...
Additional comments not posted (1)
docs/docs/tutorial/installation.md (1)
9-9: Update to Go 1.22 is correctly documented.This change ensures compatibility with the
slices.Concatfunction introduced in Go 1.22, as mentioned in the PR description.
|
@DanRoscigno thanks for pointing this out. This is actually a bug as we want to support Go 1.20+. I'll see what to do about this. I know at some point we'll want to move to Go 1.21+ and the |
|
@danielgtaylor in the similar blog post shared by @DanRoscigno, the following is pointed out.
Perhaps this is the best approach to fix the bug, similar to https://github.com/danielgtaylor/huma/blame/4a07c36b06f16d507b5f0e18a8a61fc4ed9e8112/formdata.go#L174 |
With Go < 1.22 I get this error when running the tutorial:
I think slices.Concat is new in 1.22. With 1.22.4 the tutorial works fine.
I am a tech writer by day, using Go at night to write tests of the docs that I write. I could be completely wrong about the need for 1.22, but here is my reference: https://blog.carlana.net/post/2024/golang-slices-concat/
Summary by CodeRabbit