ax(mining): replace prose comment with usage example on findAvailablePort
AX Principle 2 — comments must show HOW with real values, not restate what the function name already says. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
8e9f18ac3e
commit
301a5428b0
1 changed files with 3 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue