[PR #5209] [MERGED] pkg: use modern Go stdlib functions to simplify code #5176

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

📋 Pull Request Information

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

Base: devHead: new


📝 Commits (1)

  • 39230a9 pkg: use modern Go stdlib functions to simplify code

📊 Changes

5 files changed (+13 additions, -23 deletions)

View changed files

📝 pkg/config/legacy/conversion.go (+5 -6)
📝 pkg/config/legacy/utils.go (+2 -2)
📝 pkg/naming/names.go (+2 -3)
📝 pkg/nathole/classify.go (+2 -6)
📝 pkg/plugin/server/http.go (+2 -6)

📄 Description

Summary

  • strings.CutPrefix instead of HasPrefix+TrimPrefix (pkg/naming, pkg/config/legacy)
  • slices.Contains instead of manual for loop (pkg/plugin/server)
  • min/max builtins instead of manual if comparisons (pkg/nathole)

5 files changed, net -10 lines. All behavior-preserving, verified by Codex review.


🔄 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/5209 **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) - [`39230a9`](https://github.com/fatedier/frp/commit/39230a9bcd739c41b6f19e7e599d1e3dbf6f36ad) pkg: use modern Go stdlib functions to simplify code ### 📊 Changes **5 files changed** (+13 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `pkg/config/legacy/conversion.go` (+5 -6) 📝 `pkg/config/legacy/utils.go` (+2 -2) 📝 `pkg/naming/names.go` (+2 -3) 📝 `pkg/nathole/classify.go` (+2 -6) 📝 `pkg/plugin/server/http.go` (+2 -6) </details> ### 📄 Description ## Summary - `strings.CutPrefix` instead of `HasPrefix`+`TrimPrefix` (`pkg/naming`, `pkg/config/legacy`) - `slices.Contains` instead of manual for loop (`pkg/plugin/server`) - `min`/`max` builtins instead of manual if comparisons (`pkg/nathole`) 5 files changed, net -10 lines. All behavior-preserving, verified by Codex review. --- <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:08 -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#5176
No description provided.