server.go starts listenAndServe in an anonymous function (closes #162)
check / check (push) Canceled after 0s

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
This commit is contained in:
2026-10-19 05:59:18 +00:00
parent 7a3c706fe6
commit b27b169b27
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -22,6 +22,11 @@ Run `make frontend-viewport-test` in CI as its own step; it is not part of
# Completed Steps # 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: `main()` in `cmd/netwatch-server/main.go` is one call into a new - 2026-10-19: `main()` in `cmd/netwatch-server/main.go` is one call into a new
package, `internal/cli`, as the Go style guide asks package, `internal/cli`, as the Go style guide asks
([#160](https://git.eeqj.de/sneak/netwatch/issues/160)). `internal/cli` runs ([#160](https://git.eeqj.de/sneak/netwatch/issues/160)). `internal/cli` runs
+1 -1
View File
@@ -79,7 +79,7 @@ func New(
s.SetupRoutes() s.SetupRoutes()
s.httpServer = s.newHTTPServer() s.httpServer = s.newHTTPServer()
go s.listenAndServe() go func() { s.listenAndServe() }()
return nil return nil
}, },