summaryrefslogtreecommitdiff
path: root/internal/display/tooltip_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-18 10:10:39 +0200
committerPaul Buetow <paul@buetow.org>2026-02-18 10:10:39 +0200
commit69f5017434298f1ffd4cdc30c30b95d0f4bd344f (patch)
treec41a378bc8c4c7338f392cde7a4185658d4dfb12 /internal/display/tooltip_test.go
parentf1951f2ee1e83d802030c257d4a1df099ec08976 (diff)
refactor: enforce Go best practices (function size, ordering, formatting)
- config: split set() (62L) into setSizeAndTuning() + setDisplayFlags() - collector: split Run() (70L) into Run + startLocalScanner + startRemoteScanner + parseCollectorStream + dispatchCollectorLine; each <30L - collector: remove unused script_embed.go (RemoteScript was dead code) - display: move newRunState constructor before Run() per constructor-first rule - display: replace loadPeak IIFE with a plain initLoadPeak variable - display: split handleKey() (114L) into handleToggleKeys + handleAdjustAndSave + handleResizeKeys; add nil guard in handleResizeKeys for test safety - display: split drawNetBarSmoothed() (75L) into drawNetBarSmoothed + smoothNetUtilization + drawNetHalves; each <30L - all: gofmt -w to fix formatting drift in display and config files All tests pass (go test ./...). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/display/tooltip_test.go')
-rw-r--r--internal/display/tooltip_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/display/tooltip_test.go b/internal/display/tooltip_test.go
index e4f6afc..0d4dc57 100644
--- a/internal/display/tooltip_test.go
+++ b/internal/display/tooltip_test.go
@@ -261,10 +261,10 @@ func TestTooltipLines_Mem(t *testing.T) {
"myhost": {
CPU: map[string]collector.CPULine{"cpu": {}},
Mem: map[string]int64{
- "MemTotal": 8*1024*1024, // 8 GB in KB
- "MemFree": 2*1024*1024,
- "SwapTotal": 4*1024*1024,
- "SwapFree": 3*1024*1024,
+ "MemTotal": 8 * 1024 * 1024, // 8 GB in KB
+ "MemFree": 2 * 1024 * 1024,
+ "SwapTotal": 4 * 1024 * 1024,
+ "SwapFree": 3 * 1024 * 1024,
},
},
}