-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
fix: remove slices dependency to better support Go 1.20 #497
Conversation
WalkthroughThe recent code changes focused on enhancing the maintainability and compatibility of the Changes
Assessment against linked 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 (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #497 +/- ##
=======================================
Coverage 92.84% 92.85%
=======================================
Files 22 22
Lines 3788 3791 +3
=======================================
+ Hits 3517 3520 +3
Misses 227 227
Partials 44 44 ☔ View full report in Codecov by Sentry. |
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- adapters/humaflow/flow/flow.go (3 hunks)
- formdata.go (3 hunks)
Additional comments not posted (6)
formdata.go (2)
57-72
: LGTM! Efficiently replacesslices.ContainsFunc
.The loop correctly checks for various MIME types. This ensures compatibility with Go 1.20.
183-184
: LGTM! Correctly replacesslices.Concat
withappend
.The use of
append
ensures errors are accumulated properly, maintaining compatibility with Go 1.20.adapters/humaflow/flow/flow.go (4)
70-79
: LGTM! Efficiently implementsslicesIndex
.The function correctly returns the index of the first occurrence of an element or -1 if not found.
81-84
: LGTM! Efficiently implementsslicesContains
.The function correctly uses
slicesIndex
to check for the presence of an element.
131-133
: LGTM! Correct use ofslicesContains
.The method correctly checks for
http.MethodGet
and automatically includeshttp.MethodHead
.
194-195
: LGTM! Correct use ofslicesContains
.The method correctly checks and appends allowed methods using
slicesContains
.
This removes the
slices
package dependency which was added to Go in 1.21. This can all be cleaned up once we require Go 1.21 as the minimum version, but for now we'll support the last two releases just like the Go team does.Fixes #472.
Summary by CodeRabbit
Mux
struct.MimeTypeValidator
andMultipartFormFiles
for better performance and error handling.