aboutsummaryrefslogtreecommitdiff
path: root/hotline/server.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2025-07-04 17:24:02 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2025-07-04 17:24:02 -0700
commitee6629ad78ac62fa14371ea5ddb7474c1fe9c979 (patch)
tree186d23424e73797976f6d2f71d193bcbc71dbf76 /hotline/server.go
parent262f66351484369fa65c2e23df81ef682ea06d89 (diff)
Fix file handle close warnings by ignoring return values
Updated all file close operations to use anonymous functions that ignore return values to satisfy golangci-lint errcheck warnings.
Diffstat (limited to 'hotline/server.go')
-rw-r--r--hotline/server.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/hotline/server.go b/hotline/server.go
index 98b6132..19c7acc 100644
--- a/hotline/server.go
+++ b/hotline/server.go
@@ -235,7 +235,7 @@ func (s *Server) Serve(ctx context.Context, ln net.Listener) error {
})
s.Logger.Info("Connection established", "ip", ipAddr)
- defer conn.Close()
+ defer func() { _ = conn.Close() }()
// Check if we have an existing rate limit for the IP and create one if we do not.
rl, ok := s.rateLimiters[ipAddr]
@@ -247,7 +247,7 @@ func (s *Server) Serve(ctx context.Context, ln net.Listener) error {
// Check if the rate limit is exceeded and close the connection if so.
if !rl.Allow() {
s.Logger.Info("Rate limit exceeded", "RemoteAddr", conn.RemoteAddr())
- conn.Close()
+ _ = conn.Close()
return
}