Skip to content

Commit

Permalink
Update to go 1.21 and golangci to 1.60.0, test with go 1.23 (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhump authored Aug 23, 2024
1 parent c61fc41 commit 3738e9d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .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 @@ -30,5 +30,5 @@ jobs:
- name: Lint
# Often, lint & gofmt guidelines depend on the Go version. To prevent
# conflicting guidance, run only on the most recent supported version.
if: matrix.go-version == '1.22.x'
if: matrix.go-version == '1.23.x'
run: make checkgenerate && make lint
16 changes: 3 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,34 +27,26 @@ linters:
enable-all: true
disable:
- cyclop # covered by gocyclo
- deadcode # abandoned
- depguard # unnecessary for small libraries
- exhaustivestruct # replaced by exhaustruct
- execinquery # deprecated in golangci 1.58.0
- 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
- 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
- protogetter # too many false positives
- 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.*"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,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)/protoc-gen-go: 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 connectrpc.com/grpchealth

go 1.20
go 1.21

retract v1.1.1 // module cache poisoned, use v1.1.2

Expand Down
4 changes: 2 additions & 2 deletions grpchealth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func TestHealth(t *testing.T) {
connect.NewRequest(&healthv1.HealthCheckRequest{Service: service}),
)
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}
if Status(res.Msg.Status) != expect {
t.Fatalf("got status %v, expected %v", res.Msg.Status, expect)
Expand Down Expand Up @@ -130,7 +130,7 @@ func TestHealth(t *testing.T) {
connect.NewRequest(&healthv1.HealthCheckRequest{Service: userFQN}),
)
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}
defer stream.Close()
if ok := stream.Receive(); ok {
Expand Down

0 comments on commit 3738e9d

Please sign in to comment.