Skip to content

Commit

Permalink
Update to go1.21 and golangci 1.60.0, test with go1.23 (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhump committed Aug 20, 2024
1 parent b9ed61b commit bb123e9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.20.x, 1.21.x, 1.22.x]
go-version: [1.21.x, 1.22.x, 1.23.x]
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand All @@ -32,5 +32,6 @@ jobs:
# conflicting guidance, run only on the most recent supported version.
# For the same reason, only check generated code on the most recent
# supported version.
# TODO: change this to 1.23.x once checklocks supports Go 1.23.
if: matrix.go-version == '1.22.x'
run: make checkgenerate && make lint
17 changes: 4 additions & 13 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
run:
skip-dirs-use-default: false
linters-settings:
errcheck:
check-type-assertions: true
Expand Down Expand Up @@ -29,36 +27,29 @@ linters:
disable:
- cyclop # covered by gocyclo
- depguard # unnecessary for small libraries
- deadcode # abandoned
- exhaustivestruct # replaced by exhaustruct
- execinquery # deprecated in golangci v1.58.0
- exhaustruct # not helpful, prevents idiomatic struct literals
- funlen # rely on code review to limit function length
- gocognit # dubious "cognitive overhead" quantification
- gofumpt # prefer standard gofmt
- goimports # rely on gci instead
- golint # deprecated by Go team
- gomnd # some unnamed constants are okay
- ifshort # deprecated by author
- inamedparam # convention is not followed
- interfacer # deprecated by author
- ireturn # "accept interfaces, return structs" isn't ironclad
- lll # don't want hard limits for line length
- maintidx # covered by gocyclo
- maligned # readability trumps efficient struct packing
- mnd # some unnamed constants are okay
- nlreturn # generous whitespace violates house style
- nonamedreturns # named returns are fine; it's *bare* returns that are bad
- nosnakecase # deprecated in https://github.com/golangci/golangci-lint/pull/3065
- scopelint # deprecated by author
- structcheck # abandoned
- testpackage # internal tests are fine
- varcheck # abandoned
- wrapcheck # don't _always_ need to wrap errors
- wsl # generous whitespace violates house style
issues:
exclude-dirs-use-default: false
exclude:
# Don't ban use of fmt.Errorf to create new errors, but the remaining
# checks from err113 are useful.
- "err113: do not define dynamic errors.*"
- "do not define dynamic errors.*"
exclude-rules:
# Needlessly verbose inside of test-only code.
- path: (.+)_test\.go
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ generate: $(BIN)/license-header ## Regenerate code and licenses
.PHONY: lint
lint: $(BIN)/golangci-lint $(BIN)/checklocks ## Lint
go vet ./...
go vet -vettool=$(BIN)/checklocks ./...
#go vet -vettool=$(BIN)/checklocks ./...
golangci-lint run

.PHONY: lintfix
Expand All @@ -71,7 +71,7 @@ $(BIN)/license-header: Makefile

$(BIN)/golangci-lint: Makefile
@mkdir -p $(@D)
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.2
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.0

$(BIN)/checklocks: Makefile
@mkdir -p $(@D)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/bufbuild/httplb

go 1.20
go 1.21

require (
github.com/jonboulle/clockwork v0.4.0
Expand Down

0 comments on commit bb123e9

Please sign in to comment.