From 2e000624f4578685f223b50e32c0ef5e7c41debc Mon Sep 17 00:00:00 2001 From: sneak Date: Mon, 19 Oct 2026 05:59:18 +0000 Subject: [PATCH] server.go starts listenAndServe in an anonymous function (closes #162) The server's OnStart hook started the HTTP listener with `go s.listenAndServe()`; the Go style guide asks for a function called with `go` to be wrapped in an anonymous function, so it is now `go func() { s.listenAndServe() }()`. No other go statement in the Go code called a function directly. Nothing the server does changed. Model: opus-5-5 --- TODO.md | 5 +++++ internal/server/server.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 8c58b13..82bb8a0 100644 --- a/TODO.md +++ b/TODO.md @@ -23,6 +23,11 @@ Run `make frontend-viewport-test` in CI as its own step; it is not part of # Completed Steps +- 2026-10-19: the server's `OnStart` hook in `internal/server/server.go` starts + `listenAndServe` with `go func() { s.listenAndServe() }()`, as the Go style + guide asks ([#162](https://git.eeqj.de/sneak/netwatch/issues/162)); it was + `go s.listenAndServe()`. No other `go` statement in the Go code called a + function directly. Nothing the server does changed - 2026-10-19: `.gitignore`, `.editorconfig` and `.golangci.yml` are the sneak/prompts copies at `0653579` ([#174](https://git.eeqj.de/sneak/netwatch/issues/174)). `.gitignore` is the diff --git a/internal/server/server.go b/internal/server/server.go index 1e828de..50cac5b 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -79,7 +79,7 @@ func New( s.SetupRoutes() s.httpServer = s.newHTTPServer() - go s.listenAndServe() + go func() { s.listenAndServe() }() return nil },