diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 0000000..fd45362 --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,26 @@ +name: golangci-lint + +on: + push: + branches: + - main + pull_request: + +permissions: + contents: read + # Optional: allow read access to pull request. Use with `only-new-issues` option. + # pull-requests: read + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: stable + - name: golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: v1.60 diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..6cc924a --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,12 @@ +run: + timeout: 1m + +linters: + enable-all: false + disable-all: true + enable: + - gosimple + - govet + - ineffassign + - staticcheck + - unused diff --git a/internal/server/config.go b/internal/server/config.go index 59191ea..72b1ed5 100644 --- a/internal/server/config.go +++ b/internal/server/config.go @@ -38,19 +38,19 @@ type Config struct { type Server struct { Host string Port string - Timeout *ServerTimeout - Health *ServerHealth + Timeout *Timeout + Health *Health MaxHeaderBytes int } -type ServerTimeout struct { +type Timeout struct { Read int Write int Idle int Shutdown int } -type ServerHealth struct { +type Health struct { Timeout int Cache int Interval int @@ -151,13 +151,13 @@ func NewConfig(stdout io.Writer, args []string) (*Config, error) { Server: &Server{ Host: serverHost, Port: serverPort, - Timeout: &ServerTimeout{ + Timeout: &Timeout{ Read: serverTimeoutRead, Write: serverTimeoutWrite, Idle: serverTimeoutIdle, Shutdown: serverTimeoutShutdown, }, - Health: &ServerHealth{ + Health: &Health{ Timeout: serverHealthTimeout, Cache: serverHealthCache, Interval: serverHealthInterval,