mirror of
https://github.com/therootcompany/golib.git
synced 2026-03-02 23:57:59 +00:00
On SIGINT/SIGTERM: - Stop accepting new connections - Close connections idle longer than --idle-timeout (default 5s), determined by LastRead/LastWrite timestamps tracked per connection pair - Wait for active connections to drain up to --shutdown-timeout (default 30s) - Force-close any remaining connections if the timeout is exceeded Also switches isClosedConn to use errors.Is(err, net.ErrClosed) and exits the accept loop cleanly when a listener is closed during shutdown. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
golib
Sometimes a little copying, sometimes a little dependency. Too small for their own repos.
The default branch is dev, but the stable, versioned tags are based on main.
Also, my Go Cheatsheet:
Languages
Go
100%