[PR #5751] [MERGED] refactor: use the built-in max/min to simplify the code #5977

Closed
opened 2026-11-02 04:05:26 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5751
Author: @alaningtrump
Created: 7/3/2026
Status: ✅ Merged
Merged: 7/4/2026
Merged by: @Mahyardana

Base: main ← Head: main


📝 Commits (1)

  • dc6f66c refactor: use the built-in max/min to simplify the code

📊 Changes

1 file changed (+2 additions, -8 deletions)

View changed files

📝 internal/web/service/client_groups.go (+2 -8)

📄 Description

Summary

In Go 1.21, the standard library includes built-in max/min function, which can greatly simplify the code.

Why

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Documentation
  • Tests only
  • Build / CI / tooling
  • Other

Areas affected

  • Frontend (UI / panel pages)
  • Backend (API endpoints, login, settings)
  • Xray config generation
  • Subscription (share links / Clash / JSON)
  • Statistics / traffic counters
  • Database / migrations
  • Install / upgrade script
  • Docker image
  • Multi-node (sub-nodes)
  • Telegram bot

How was this tested?

Screenshots / recordings

Breaking changes

Checklist

  • I tested the change locally and confirmed the described behavior.
  • I added or updated tests for the new behavior (when applicable).
  • go build ./... and the test suite pass locally.
  • For frontend changes: npm run lint, npm run typecheck, and npm run build pass.
  • I updated the Wiki / README / API docs if user-facing behavior changed.
  • My commits follow the project's existing message style.
  • I have no unrelated changes mixed into this PR.

🔄 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/MHSanaei/3x-ui/pull/5751 **Author:** [@alaningtrump](https://github.com/alaningtrump) **Created:** 7/3/2026 **Status:** ✅ Merged **Merged:** 7/4/2026 **Merged by:** [@Mahyardana](https://github.com/Mahyardana) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`dc6f66c`](https://github.com/MHSanaei/3x-ui/commit/dc6f66cf88ea80b02069704ba90fef4983421222) refactor: use the built-in max/min to simplify the code ### 📊 Changes **1 file changed** (+2 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `internal/web/service/client_groups.go` (+2 -8) </details> ### 📄 Description ## Summary In Go 1.21, the standard library includes built-in [max/min](https://pkg.go.dev/builtin@go1.21.0#max) function, which can greatly simplify the code. ## Why <!-- What problem does this solve, or what use case does it enable? Link related issues here: "Closes #123", "Refs #456". --> ## Type of change - [ ] Bug fix - [ ] New feature - [x] Refactoring (no behavior change) - [ ] Documentation - [ ] Tests only - [ ] Build / CI / tooling - [ ] Other ## Areas affected - [ ] Frontend (UI / panel pages) - [ ] Backend (API endpoints, login, settings) - [ ] Xray config generation - [ ] Subscription (share links / Clash / JSON) - [ ] Statistics / traffic counters - [ ] Database / migrations - [ ] Install / upgrade script - [ ] Docker image - [ ] Multi-node (sub-nodes) - [ ] Telegram bot ## How was this tested? <!-- Concrete steps the reviewer can repeat. For UI changes: which page, which actions, which browser. For backend: which endpoint, which payload, which response. Mention any new unit/integration tests added. --> ## Screenshots / recordings <!-- Required for UI changes. Drag images or GIFs here. Remove if N/A. --> ## Breaking changes <!-- Does this change require existing users to update their config, run a migration, or change their API calls? If yes, describe the migration path. Write "None" if there are no breaking changes. --> ## Checklist - [x] I tested the change locally and confirmed the described behavior. - [ ] I added or updated tests for the new behavior (when applicable). - [x] `go build ./...` and the test suite pass locally. - [x] For frontend changes: `npm run lint`, `npm run typecheck`, and `npm run build` pass. - [ ] I updated the Wiki / README / API docs if user-facing behavior changed. - [ ] My commits follow the project's existing message style. - [x] I have no unrelated changes mixed into this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:05:26 +07: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
MHSanaei/3x-ui#5977
No description provided.