Skip to content
This repository was archived by the owner on Apr 17, 2026. It is now read-only.

chore(simplify): simplify recent changes in qurl-reverse-proxy#7

Open
justin-layerv wants to merge 1 commit into
mainfrom
simplify/sweep-2026-04-02
Open

chore(simplify): simplify recent changes in qurl-reverse-proxy#7
justin-layerv wants to merge 1 commit into
mainfrom
simplify/sweep-2026-04-02

Conversation

@justin-layerv
Copy link
Copy Markdown
Collaborator

Summary

  • pkg/banner/banner.go (new): Extract shared printBanner() and ANSI color constants from duplicated definitions in both client and server entry points
  • cmd/frpc/main.go: Rename cryptic audpAgent, consolidate duplicate getConfigFile() calls, extract hasConfigFlag() helper, reuse exeBinDir for public dir path
  • cmd/frps/root.go: Use shared banner.Print(), remove duplicate color constants and banner function, remove unnecessary named return in runServer()

Notes

  • No behavior changes — pure refactoring
  • Pre-existing build issue: cmd/frpc cannot compile due to missing third_party/opennhp/nhp directory (transitive dependency). This is unrelated to these changes. cmd/frps and pkg/ packages compile and pass go vet cleanly.
  • No test files exist in the project, so verification was done via go vet and gofmt

Test plan

  • Verify go vet ./pkg/... and go vet ./cmd/frps/ pass
  • Verify gofmt -l reports no formatting issues
  • Verify banner output unchanged for both client and server

🤖 Generated with Claude Code

…try points

- Extract duplicate printBanner() and ANSI color constants into pkg/banner
- Rename cryptic variable `a` to `udpAgent` in nhpAgentStart
- Eliminate duplicate getConfigFile() call in frpc main()
- Extract hasConfigFlag() helper to avoid duplicated flag-scanning loop
- Remove unnecessary named return in runServer()
- Reuse exeBinDir for public dir path instead of redundant os.Executable() call

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant