-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Use strings.Cut in a few places #971
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
Merged
Merged
+6
−21
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Now that we're 1.20+ instead of 1.14+ we can use 1.18's strings.Cut in a few places to simplify code.
VojtechVitek
approved these changes
Feb 4, 2025
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.
LGTM. Nice work!
david-littlefarmer
approved these changes
Feb 4, 2025
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.
LGTM
saschazepter
pushed a commit
to saschazepter/forgejo
that referenced
this pull request
Jun 21, 2025
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/go-chi/chi/v5](https://github.com/go-chi/chi) | require | patch | `v5.2.1` -> `v5.2.2` | --- ### Release Notes <details> <summary>go-chi/chi (github.com/go-chi/chi/v5)</summary> ### [`v5.2.2`](https://github.com/go-chi/chi/releases/tag/v5.2.2) [Compare Source](go-chi/chi@v5.2.1...v5.2.2) #### What's Changed - Use strings.Cut in a few places by [@​JRaspass](https://github.com/JRaspass) in go-chi/chi#971 - Fix non-constant format strings in t.Fatalf by [@​JRaspass](https://github.com/JRaspass) in go-chi/chi#972 - Apply fieldalignment fixes to optimize struct memory layout by [@​pixel365](https://github.com/pixel365) in go-chi/chi#974 - go 1.24 by [@​pkieltyka](https://github.com/pkieltyka) in go-chi/chi#977 - chore: delint ioutil usage by [@​costela](https://github.com/costela) in go-chi/chi#962 - Fixed typo in Router interface definition by [@​mithileshgupta12](https://github.com/mithileshgupta12) in go-chi/chi#958 - Add support for TinyGo by [@​efraimbart](https://github.com/efraimbart) in go-chi/chi#978 - Exclude middleware/profiler.go in TinyGo, as there's no net/http/pprof pkg by [@​cxjava](https://github.com/cxjava) in go-chi/chi#982 - Make use of strings.Cut by [@​scop](https://github.com/scop) in go-chi/chi#1005 - Change install command format to code block by [@​sglkc](https://github.com/sglkc) in go-chi/chi#1001 - Correct documentation by [@​mrdomino](https://github.com/mrdomino) in go-chi/chi#992 #### Security fix - Fixes [GHSA-vrw8-fxc6-2r93](GHSA-vrw8-fxc6-2r93) - "Host Header Injection Leads to Open Redirect in RedirectSlashes" [commit](go-chi/chi@1be7ad9) - a lower-severity Open Redirect that can't be exploited in browser or email client, as it requires manipulation of a Host header - reported by Anuraag Baishya, [@​anuraagbaishya](https://github.com/anuraagbaishya). Thank you! #### New Contributors - [@​pixel365](https://github.com/pixel365) made their first contribution in go-chi/chi#974 - [@​mithileshgupta12](https://github.com/mithileshgupta12) made their first contribution in go-chi/chi#958 - [@​efraimbart](https://github.com/efraimbart) made their first contribution in go-chi/chi#978 - [@​cxjava](https://github.com/cxjava) made their first contribution in go-chi/chi#982 - [@​sglkc](https://github.com/sglkc) made their first contribution in go-chi/chi#1001 - [@​mrdomino](https://github.com/mrdomino) made their first contribution in go-chi/chi#992 **Full Changelog**: go-chi/chi@v5.2.1...v5.2.2 </details> --- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC41Ny4xIiwidXBkYXRlZEluVmVyIjoiNDAuNTcuMSIsInRhcmdldEJyYW5jaCI6ImZvcmdlam8iLCJsYWJlbHMiOlsiZGVwZW5kZW5jeS11cGdyYWRlIiwidGVzdC9ub3QtbmVlZGVkIl19--> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8248 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org> Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Now that we're 1.20+ instead of 1.14+ we can use 1.18's strings.Cut in a few places to simplify code.