From 301a5428b01caab02fee29b56a3cba0ba1c1d1d3 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 09:11:24 +0100 Subject: [PATCH] ax(mining): replace prose comment with usage example on findAvailablePort MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AX Principle 2 — comments must show HOW with real values, not restate what the function name already says. Co-Authored-By: Charon --- pkg/mining/manager.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/mining/manager.go b/pkg/mining/manager.go index 14ec085..e4b099e 100644 --- a/pkg/mining/manager.go +++ b/pkg/mining/manager.go @@ -213,7 +213,9 @@ func (m *Manager) autostartMiners() { } } -// findAvailablePort finds an available TCP port on the local machine. +// port, err := findAvailablePort() +// if err != nil { return 0, err } +// config.HTTPPort = port func findAvailablePort() (int, error) { addr, err := net.ResolveTCPAddr("tcp", "localhost:0") if err != nil {