Skip to content

Commit

Permalink
chore: update Go, linter, and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Dec 3, 2024
1 parent bf9a86a commit 097282b
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 66 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/go-cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,8 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:

# https://github.com/marketplace/actions/checkout
- name: Checkout code
uses: actions/checkout@v4

# https://github.com/marketplace/actions/setup-go-environment
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

Expand Down
17 changes: 4 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ name: Main
on:
push:
branches:
- main
- master
tags:
- v*
pull_request:

jobs:
Expand All @@ -15,20 +14,12 @@ jobs:
runs-on: ubuntu-latest
env:
GO_VERSION: stable
GOLANGCI_LINT_VERSION: v1.56.0
GOLANGCI_LINT_VERSION: v1.62.2
CGO_ENABLED: 0

steps:

# https://github.com/marketplace/actions/checkout
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0

# https://github.com/marketplace/actions/setup-go-environment
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

Expand Down
75 changes: 34 additions & 41 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
run:
timeout: 5m
show-stats: true
skip-files: [ ]
skip-dirs: [ ]

linters:
enable-all: true
disable:
- exportloopref # deprecated
- sqlclosecheck # not relevant (SQL)
- rowserrcheck # not relevant (SQL)
- cyclop # duplicate of gocyclo
- lll
- dupl
- wsl
- nlreturn
- mnd
- err113
- errname # Require a breaking change.
- wrapcheck
- exhaustive
- exhaustruct
- testpackage
- tparallel
- paralleltest
- prealloc
- forcetypeassert
- noctx

linters-settings:
govet:
Expand All @@ -11,8 +30,6 @@ linters-settings:
- fieldalignment
gocyclo:
min-complexity: 15
maligned:
suggest-new: true
goconst:
min-len: 5
min-occurrences: 3
Expand Down Expand Up @@ -48,40 +65,6 @@ linters-settings:
hugeParam:
sizeThreshold: 100

linters:
enable-all: true
disable:
- deadcode # deprecated
- exhaustivestruct # deprecated
- golint # deprecated
- ifshort # deprecated
- interfacer # deprecated
- maligned # deprecated
- nosnakecase # deprecated
- scopelint # deprecated
- structcheck # deprecated
- varcheck # deprecated
- sqlclosecheck # not relevant (SQL)
- rowserrcheck # not relevant (SQL)
- execinquery # not relevant (SQL)
- cyclop # duplicate of gocyclo
- lll
- dupl
- wsl
- nlreturn
- gomnd
- goerr113
- wrapcheck
- exhaustive
- exhaustruct
- testpackage
- tparallel
- paralleltest
- prealloc
- ifshort
- forcetypeassert
- noctx

issues:
exclude-use-default: false
max-issues-per-linter: 0
Expand All @@ -98,3 +81,13 @@ issues:
- bodyclose
- path: response.go # errname
text: 'the type name `ErrorResponse` should conform to the `XxxError` format'

output:
show-stats: true
sort-results: true
sort-order:
- linter
- file

run:
timeout: 5m
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module github.com/nrdcg/goinwx

go 1.19
go 1.21

require (
github.com/fatih/structs v1.1.0
github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1
github.com/go-viper/mapstructure/v2 v2.2.1
github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss=
github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b h1:udzkj9S/zlT5X367kqJis0QP7YMxobob6zhzq6Yre00=
github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b/go.mod h1:pcaDhQK0/NJZEvtCO0qQPPropqV0sJOJ6YW7X+9kRwM=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
Expand Down

0 comments on commit 097282b

Please sign in to comment.