Skip to content

Commit

Permalink
Upgrade to go 1.23
Browse files Browse the repository at this point in the history
  • Loading branch information
o1egl committed Feb 11, 2025
1 parent 19734a4 commit daf8f67
Show file tree
Hide file tree
Showing 8 changed files with 250 additions and 222 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
- uses: actions/setup-go@V5
with:
go-version: 1.19
- uses: actions/checkout@v3
go-version: 1.23
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: v1.48.0
version: v1.63
test:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
- uses: actions/setup-go@V5
with:
go-version: 1.19
- uses: actions/checkout@v3
go-version: 1.23
- uses: actions/checkout@v4
- run: go test -v -covermode=atomic -coverprofile=coverage.out ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
124 changes: 60 additions & 64 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,100 +1,96 @@
run:
timeout: 5m
go: '1.18'

linters-settings:
dupl:
threshold: 100
funlen:
lines: 100
statements: 50
goconst:
min-len: 2
min-occurrences: 3
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- dupImport # https://github.com/go-critic/go-critic/issues/845
- ifElseChain
- octalLiteral
- whyNoLint
- wrapperFunc
- hugeParam
gocyclo:
min-complexity: 15
goimports:
local-prefixes: github.com/o1egl/fwencoder
gomnd:
# don't include the "operation" and "assign"
checks:
- argument
- case
- condition
- return
ignored-numbers:
- '0'
- '1'
- '2'
- '3'
ignored-functions:
- strconv.Format*
- strconv.Parse*

govet:
check-shadowing: true
lll:
line-length: 140
misspell:
locale: US
nolintlint:
allow-leading-space: false
allow-unused: false # report any unused nolint directives
require-explanation: false # don't require an explanation for nolint directives
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
go: '1.23'

linters:
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
- copyloopvar
- dogsled
- dupl
- errcheck
- exportloopref
- errorlint
- funlen
- gocheckcompilerdirectives
- gochecknoinits
- goconst
- gocritic
- gocyclo
- godox
- gofmt
- goimports
- gomnd
- mnd
- goprintffuncname
- gosec
- gosimple
- govet
- intrange
- ineffassign
- lll
- misspell
- nakedret
- noctx
- nolintlint
- revive
- staticcheck
- structcheck
- stylecheck
- typecheck
- testifylint
- unconvert
- unparam
- unused
- varcheck
- whitespace

linters-settings:
goimports:
local-prefixes: github.com/o1egl/fwencoder
dupl:
threshold: 100
funlen:
lines: -1 # the number of lines (code + empty lines) is not a right metric and leads to code without empty line or one-liner.
statements: 50
goconst:
min-len: 2
min-occurrences: 3
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- dupImport # https://github.com/go-critic/go-critic/issues/845
- ifElseChain
- octalLiteral
- whyNoLint
gocyclo:
min-complexity: 15
godox:
keywords:
- FIXME
gofmt:
rewrite-rules:
- pattern: 'interface{}'
replacement: 'any'
errorlint:
asserts: false
lll:
line-length: 140
misspell:
locale: US
nolintlint:
allow-unused: false # report any unused nolint directives
require-explanation: true # require an explanation for nolint directives
require-specific: true # require nolint directives to be specific about which linter is being skipped
revive:
rules:
- name: indent-error-flow
- name: unexported-return
disabled: true
- name: unused-parameter
- name: unused-receiver

issues:
exclude-rules:
- text: "shadow: declaration of \"err\" shadows declaration"
Expand All @@ -103,7 +99,7 @@ issues:
- path: _test\.go
linters:
- bodyclose
- gomnd
- mnd
- noctx
- goconst
- funlen
Expand Down
Loading

0 comments on commit daf8f67

Please sign in to comment.