// SPDX-FileCopyrightText: 2026 Echolot contributors // SPDX-License-Identifier: GPL-3.0-or-later //go:build windows package selftest import ( "errors" "syscall" ) // Winsock reports a taken port as WSAEADDRINUSE (10048), which syscall.EADDRINUSE does not match // on Windows — and the stdlib syscall package does not export the WSA constant. The server // deploys on Linux; this exists so the tests tell the truth on a Windows development machine too. const wsaeaddrinuse = syscall.Errno(10048) func isAddrInUse(err error) bool { return errors.Is(err, wsaeaddrinuse) || errors.Is(err, syscall.EADDRINUSE) }