style: drop the line comments added with the triage fixes

CLAUDE.md rules out // line comments in committed Go. The rationale they
carried is in the commit messages for each fix; doc comments that already
existed are kept, updated where the code they describe changed.

Also replaces reflect.Ptr with reflect.Pointer and rewrites the YAML keyword
alternation as a lookup table, both flagged by golangci-lint.
This commit is contained in:
Sanaei
2026-07-27 14:37:57 +02:00
parent 6f4cc1e53c
commit 8bc00d1e90
8 changed files with 14 additions and 87 deletions
@@ -91,9 +91,6 @@ func TestDepletedCond_ProbeGuard(t *testing.T) {
}
}
// A master that stopped pushing leaves its last snapshot behind forever. Those
// frozen counters must not keep enforcing quota, or a client well inside its
// limit is disabled on every traffic poll with no way back (#6113).
func TestStaleGlobalTraffic_Ignored(t *testing.T) {
db := initTrafficTestDB(t)
svc := &InboundService{}
@@ -112,7 +109,6 @@ func TestStaleGlobalTraffic_Ignored(t *testing.T) {
}
t.Run("stale row alone neither enforces nor selects the cross-panel predicate", func(t *testing.T) {
// 200 of 1000 used locally, 1900 reported by a master gone for a day.
seedClientRow(t, "cap", 1, 100, 100, 1000)
seedStaleGlobal(t, "dead-master", "cap", 1000, 900)
@@ -138,8 +134,6 @@ func TestStaleGlobalTraffic_Ignored(t *testing.T) {
})
t.Run("a live master still enforces alongside the stale row", func(t *testing.T) {
// This is the #6113 shape: one dead master frozen over quota, one live
// master well under it. Only the live one may decide.
if err := svc.AcceptGlobalTraffic("live-master", []*xray.ClientTraffic{{Email: "cap", Up: 1, Down: 1}}); err != nil {
t.Fatalf("AcceptGlobalTraffic: %v", err)
}
@@ -152,7 +146,6 @@ func TestStaleGlobalTraffic_Ignored(t *testing.T) {
t.Fatalf("the live master reports usage well under quota, disabled %d", count)
}
// And once the live master reports real depletion, it takes effect.
if err := svc.AcceptGlobalTraffic("live-master", []*xray.ClientTraffic{{Email: "cap", Up: 600, Down: 500}}); err != nil {
t.Fatalf("AcceptGlobalTraffic: %v", err)
}