[PR #5215] [MERGED] refactor: fix modernize lint issues #5180

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

📋 Pull Request Information

Original PR: https://github.com/fatedier/frp/pull/5215
Author: @alexandear
Created: 3/7/2026
Status: Merged
Merged: 3/7/2026
Merged by: @fatedier

Base: devHead: refactor/modernize


📝 Commits (1)

  • e298293 refactor: fix modernize lint issues

📊 Changes

37 files changed (+152 additions, -152 deletions)

View changed files

📝 .golangci.yml (+4 -0)
📝 client/proxy/sudp.go (+1 -1)
📝 client/proxy/udp.go (+1 -1)
📝 client/proxy/xtcp.go (+1 -1)
📝 pkg/config/legacy/proxy.go (+8 -8)
📝 pkg/config/legacy/visitor.go (+3 -3)
📝 pkg/config/template.go (+1 -1)
📝 pkg/config/types/types.go (+2 -2)
📝 pkg/config/v1/proxy.go (+8 -8)
📝 pkg/config/v1/proxy_plugin.go (+10 -10)
📝 pkg/config/v1/visitor.go (+3 -3)
📝 pkg/config/v1/visitor_plugin.go (+1 -1)
📝 pkg/msg/msg.go (+1 -1)
📝 pkg/nathole/analysis.go (+1 -1)
📝 pkg/nathole/nathole.go (+2 -2)
📝 pkg/plugin/visitor/virtual_net.go (+1 -4)
📝 pkg/policy/featuregate/feature_gate.go (+5 -12)
📝 pkg/util/http/http.go (+3 -3)
📝 pkg/util/net/udp.go (+1 -5)
📝 pkg/util/util/util.go (+2 -2)

...and 17 more files

📄 Description

WHY

Encourage up-to-date Go idioms and cleaner code by adding the modernize linter.

I decided to disable the omitzero rule because fixing it leads to some behavioural changes. It can be fixed in a separate PR.

modernize issues were fixed via running the following command:

$ golangci-lint run --enable-only modernize --fix

🔄 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/5215 **Author:** [@alexandear](https://github.com/alexandear) **Created:** 3/7/2026 **Status:** ✅ Merged **Merged:** 3/7/2026 **Merged by:** [@fatedier](https://github.com/fatedier) **Base:** `dev` ← **Head:** `refactor/modernize` --- ### 📝 Commits (1) - [`e298293`](https://github.com/fatedier/frp/commit/e2982935aa0fab84a255e781a70dea9a1f0e6fdf) refactor: fix modernize lint issues ### 📊 Changes **37 files changed** (+152 additions, -152 deletions) <details> <summary>View changed files</summary> 📝 `.golangci.yml` (+4 -0) 📝 `client/proxy/sudp.go` (+1 -1) 📝 `client/proxy/udp.go` (+1 -1) 📝 `client/proxy/xtcp.go` (+1 -1) 📝 `pkg/config/legacy/proxy.go` (+8 -8) 📝 `pkg/config/legacy/visitor.go` (+3 -3) 📝 `pkg/config/template.go` (+1 -1) 📝 `pkg/config/types/types.go` (+2 -2) 📝 `pkg/config/v1/proxy.go` (+8 -8) 📝 `pkg/config/v1/proxy_plugin.go` (+10 -10) 📝 `pkg/config/v1/visitor.go` (+3 -3) 📝 `pkg/config/v1/visitor_plugin.go` (+1 -1) 📝 `pkg/msg/msg.go` (+1 -1) 📝 `pkg/nathole/analysis.go` (+1 -1) 📝 `pkg/nathole/nathole.go` (+2 -2) 📝 `pkg/plugin/visitor/virtual_net.go` (+1 -4) 📝 `pkg/policy/featuregate/feature_gate.go` (+5 -12) 📝 `pkg/util/http/http.go` (+3 -3) 📝 `pkg/util/net/udp.go` (+1 -5) 📝 `pkg/util/util/util.go` (+2 -2) _...and 17 more files_ </details> ### 📄 Description ### WHY Encourage up-to-date Go idioms and cleaner code by adding the [`modernize`](https://golangci-lint.run/docs/linters/configuration/#modernize) linter. I decided to disable the `omitzero` rule because fixing it leads to some behavioural changes. It can be fixed in a separate PR. `modernize` issues were fixed via running the following command: ```console $ golangci-lint run --enable-only modernize --fix ``` --- <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:14 -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#5180
No description provided.