enhancement: move server declaration to go func to allocate it in stack (#4739)
Some checks failed
CodeQL / Analyze (go) (push) Has been cancelled
build / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled

Fix #4735
Close #4736
This commit is contained in:
Qingwei Li
2026-03-25 14:22:49 +08:00
committed by GitHub
parent 14e3995a06
commit 1acf980e95

View File

@@ -122,13 +122,12 @@ func startHttpServer(address listenAddress, actionChannel chan []*action, getHan
}
}
server := httpServer{
apiKey: []byte(apiKey),
actionChannel: actionChannel,
getHandler: getHandler,
}
go func() {
server := httpServer{
apiKey: []byte(apiKey),
actionChannel: actionChannel,
getHandler: getHandler,
}
for {
conn, err := listener.Accept()
if err != nil {