Skip to content

Commit

Permalink
ci: Added golangci-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jkitajima committed Jan 11, 2025
1 parent 9b2d6f8 commit ef42265
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 6 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
run:
timeout: 1m

linters:
enable-all: false
disable-all: true
enable:
- gosimple
- govet
- ineffassign
- staticcheck
- unused
12 changes: 6 additions & 6 deletions internal/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ef42265

Please # to comment.