enable godot, misspell linters

This commit is contained in:
onyx-and-iris 2026-02-15 17:14:34 +00:00
parent f6ea67b88c
commit fc6ac8fa4e
5 changed files with 10 additions and 7 deletions

3
.gitignore vendored
View File

@ -26,3 +26,6 @@ go.work
# Added by goreleaser init: # Added by goreleaser init:
dist/ dist/
# env files
.envrc

View File

@ -6,7 +6,7 @@ run:
go: '1.24' go: '1.24'
linters: linters:
disable: [errcheck, godot, misspell] disable: [errcheck]
enable: enable:
# Default enabled linters # Default enabled linters
- errcheck # Check for unchecked errors - errcheck # Check for unchecked errors

View File

@ -114,7 +114,7 @@ func main() {
log.Fatal(cmd.Run(context.Background(), os.Args)) 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. // 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. // server.ListenAndServe blocks until the server is stopped or an error occurs.
func launchProxy(cfg proxyConfig, errChan chan<- error) { func launchProxy(cfg proxyConfig, errChan chan<- error) {
@ -131,7 +131,7 @@ func launchProxy(cfg proxyConfig, errChan chan<- error) {
return 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() errChan <- server.ListenAndServe()
} }

View File

@ -9,7 +9,7 @@ import (
// Option is a functional option type that allows us to configure the Client. // Option is a functional option type that allows us to configure the Client.
type Option func(*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 { func WithSessionTimeout(timeout time.Duration) Option {
return func(c *Client) { return func(c *Client) {
if timeout < time.Minute { if timeout < time.Minute {

View File

@ -2,7 +2,7 @@ package udpproxy
import "sync" import "sync"
// sessionCache tracks connection sessions // sessionCache tracks connection sessions.
type sessionCache struct { type sessionCache struct {
mu sync.RWMutex mu sync.RWMutex
data map[string]*session 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) { func (sc *sessionCache) read(addr string) (*session, bool) {
sc.mu.RLock() sc.mu.RLock()
defer sc.mu.RUnlock() defer sc.mu.RUnlock()