[PR #5210] [MERGED] pkg/config: use modern Go stdlib for sorting and string operations #5174

Closed
opened 2026-05-05 14:56:07 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fatedier/frp/pull/5210
Author: @fatedier
Created: 3/6/2026
Status: Merged
Merged: 3/6/2026
Merged by: @fatedier

Base: devHead: new


📝 Commits (1)

  • 48c5faa pkg/config: use modern Go stdlib for sorting and string operations

📊 Changes

4 files changed (+59 additions, -27 deletions)

View changed files

📝 pkg/config/source/aggregator.go (+7 -15)
📝 pkg/config/source/aggregator_test.go (+21 -0)
📝 pkg/config/types/types.go (+6 -12)
📝 pkg/config/types/types_test.go (+25 -0)

📄 Description

Summary

  • Replace manual map-to-slice + sort.Slice with slices.SortedFunc(maps.Values(...)) + cmp.Compare in source/aggregator.go
  • Replace HasSuffix+TrimSuffix with strings.CutSuffix and deduplicate error handling in types/types.go

2 files changed, net -14 lines. All behavior-preserving, verified by Codex review. Tests pass.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fatedier/frp/pull/5210 **Author:** [@fatedier](https://github.com/fatedier) **Created:** 3/6/2026 **Status:** ✅ Merged **Merged:** 3/6/2026 **Merged by:** [@fatedier](https://github.com/fatedier) **Base:** `dev` ← **Head:** `new` --- ### 📝 Commits (1) - [`48c5faa`](https://github.com/fatedier/frp/commit/48c5faa3e30ec9fe88eb30292e556c5a825bcfe6) pkg/config: use modern Go stdlib for sorting and string operations ### 📊 Changes **4 files changed** (+59 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `pkg/config/source/aggregator.go` (+7 -15) 📝 `pkg/config/source/aggregator_test.go` (+21 -0) 📝 `pkg/config/types/types.go` (+6 -12) 📝 `pkg/config/types/types_test.go` (+25 -0) </details> ### 📄 Description ## Summary - Replace manual map-to-slice + `sort.Slice` with `slices.SortedFunc(maps.Values(...))` + `cmp.Compare` in `source/aggregator.go` - Replace `HasSuffix`+`TrimSuffix` with `strings.CutSuffix` and deduplicate error handling in `types/types.go` 2 files changed, net -14 lines. All behavior-preserving, verified by Codex review. Tests pass. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 14:56:07 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#5174
No description provided.