From fc6ac8fa4e4b518da3733aeb72a3427b586bbf73 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sun, 15 Feb 2026 17:14:34 +0000 Subject: [PATCH] enable godot, misspell linters --- .gitignore | 5 ++++- .golangci.yml | 2 +- cmd/q3rcon-proxy/main.go | 4 ++-- option.go | 2 +- sessioncache.go | 4 ++-- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index f022b13..1afa87a 100644 --- a/.gitignore +++ b/.gitignore @@ -25,4 +25,7 @@ go.work # End of gignore: github.com/onyx-and-iris/gignore # Added by goreleaser init: -dist/ \ No newline at end of file +dist/ + +# env files +.envrc \ No newline at end of file diff --git a/.golangci.yml b/.golangci.yml index 7c86c25..8c5b064 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,7 +6,7 @@ run: go: '1.24' linters: - disable: [errcheck, godot, misspell] + disable: [errcheck] enable: # Default enabled linters - errcheck # Check for unchecked errors diff --git a/cmd/q3rcon-proxy/main.go b/cmd/q3rcon-proxy/main.go index 2ebf700..19f0bca 100644 --- a/cmd/q3rcon-proxy/main.go +++ b/cmd/q3rcon-proxy/main.go @@ -114,7 +114,7 @@ func main() { log.Fatal(cmd.Run(context.Background(), os.Args)) } -// launchProxy initializes the UDP proxy server with the given configuration. +// launchProxy initialises the UDP proxy server with the given configuration. // It listens on the specified proxy host and port, and forwards traffic to the target host and port. // server.ListenAndServe blocks until the server is stopped or an error occurs. func launchProxy(cfg proxyConfig, errChan chan<- error) { @@ -131,7 +131,7 @@ func launchProxy(cfg proxyConfig, errChan chan<- error) { return } - log.Printf("q3rcon-proxy initialized: [proxy] (%s) [target] (%s)", hostAddr, proxyAddr) + log.Printf("q3rcon-proxy initialised: [proxy] (%s) [target] (%s)", hostAddr, proxyAddr) errChan <- server.ListenAndServe() } diff --git a/option.go b/option.go index fe8ac68..428c8c0 100644 --- a/option.go +++ b/option.go @@ -9,7 +9,7 @@ import ( // Option is a functional option type that allows us to configure the Client. type Option func(*Client) -// WithSessionTimeout is a functional option to set the session timeout +// WithSessionTimeout is a functional option to set the session timeout. func WithSessionTimeout(timeout time.Duration) Option { return func(c *Client) { if timeout < time.Minute { diff --git a/sessioncache.go b/sessioncache.go index 7808364..25285ab 100644 --- a/sessioncache.go +++ b/sessioncache.go @@ -2,7 +2,7 @@ package udpproxy import "sync" -// sessionCache tracks connection sessions +// sessionCache tracks connection sessions. type sessionCache struct { mu sync.RWMutex data map[string]*session @@ -15,7 +15,7 @@ func newSessionCache() sessionCache { } } -// read returns the associated session for an addr +// read returns the associated session for an addr. func (sc *sessionCache) read(addr string) (*session, bool) { sc.mu.RLock() defer sc.mu.RUnlock()