Closed DanRoscigno closed 2 weeks ago
The 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.
Files | Change Summary |
---|---|
docs/docs/tutorial/installation.md |
Updated the required Go version from 1.20 to 1.22 |
In the land of code, where versions grow, Huma's heart now beats with Go. From one point two-oh, we leap to two-two, Ensuring our path is fresh and new. Hop along, dear coder, with cheer and delight, For with Go 1.22, our future is bright! 🐇✨
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?
@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 slices
package was introduced in 1.21.
@danielgtaylor in the similar blog post shared by @DanRoscigno, the following is pointed out.
It’s worth noting that if you only want to concatenate two slices, there’s no need to use slices.Concat. You can use the built in append function with the ... spread operator instead:
concat := append(s1, s2...)
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