Skip to content

Commit

Permalink
Upgrade to Go1.19, Golangci-lint v1.48.0, address all linter issues (d…
Browse files Browse the repository at this point in the history
  • Loading branch information
berndverst authored Aug 19, 2022
1 parent b4f1a37 commit 032581d
Show file tree
Hide file tree
Showing 146 changed files with 1,356 additions and 1,277 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dapr-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ on:

env:
# Version of Go
GOVER: "1.18"
GOVER: "1.19"
# Configure proxy for Go modules
GOPROXY: https://proxy.golang.org
# Version of kubectl
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dapr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ on:

env:
# Version of Go
GOVER: "1.18"
GOVER: "1.19"
# Configure proxy for Go modules
GOPROXY: https://proxy.golang.org
# Version of kubectl
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dapr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
name: Build ${{ matrix.target_os }}_${{ matrix.target_arch }} binaries
runs-on: ${{ matrix.os }}
env:
GOVER: "1.18"
GOLANGCILINT_VER: v1.45.2
GOVER: "1.19"
GOLANGCILINT_VER: v1.48.0
PROTOC_VERSION: "21.1"
GOOS: ${{ matrix.target_os }}
GOARCH: ${{ matrix.target_arch }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kind-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
DAPR_REGISTRY: localhost:5000/dapr
DAPR_TAG: dev
DAPR_NAMESPACE: dapr-tests
GOVER: 1.18
GOVER: 1.19
# Container registry where to cache e2e test images
DAPR_CACHE_REGISTRY: "dapre2eacr.azurecr.io"
PULL_POLICY: IfNotPresent
Expand Down
21 changes: 14 additions & 7 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ run:
concurrency: 4

# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 10m
deadline: 15m

# exit code when at least one issue was found, default is 1
issues-exit-code: 1
Expand All @@ -30,10 +30,10 @@ run:
# won't be reported. Default value is empty list, but there is
# no need to include all autogenerated files, we confidently recognize
# autogenerated files. If it's not please let us know.
skip-files:
# skip-files:
# - ".*\\.my\\.go$"
# - lib/bad.go

# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number"
Expand Down Expand Up @@ -64,7 +64,7 @@ linters-settings:

# path to a file containing a list of functions to exclude from checking
# see https://github.com/kisielk/errcheck#excluding-functions for details
exclude:
# exclude:

funlen:
lines: 60
Expand Down Expand Up @@ -93,6 +93,9 @@ linters-settings:
golint:
# minimal confidence for issues, default is 0.8
min-confidence: 0.8
revive:
# minimal confidence for issues, default is 0.8
confidence: 0.8
gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: true
Expand Down Expand Up @@ -167,7 +170,7 @@ linters-settings:
# See https://go-critic.github.io/overview#checks-overview
# To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run`
# By default list of stable checks is used.
enabled-checks:
# enabled-checks:

# Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty
disabled-checks:
Expand Down Expand Up @@ -245,6 +248,7 @@ linters:
- nestif
- nlreturn
- exhaustive
- exhaustruct
- noctx
- gci
- golint
Expand All @@ -260,7 +264,6 @@ linters:
- godot
- cyclop
- varnamelen
- gosec
- errorlint
- forcetypeassert
- ifshort
Expand All @@ -272,4 +275,8 @@ linters:
- wastedassign
- containedctx
- gosimple
- forbidigo
- nonamedreturns
- asasalint
- rowserrcheck
- sqlclosecheck
- structcheck
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@ test: test-deps
# Target: lint #
################################################################################
# Due to https://github.com/golangci/golangci-lint/issues/580, we need to add --fix for windows
# Please use golangci-lint version v1.45.2 , otherwise you might encounter errors.
# You can download version v1.45.2 at https://github.com/golangci/golangci-lint/releases/tag/v1.45.2
# Please use golangci-lint version v1.48.0 , otherwise you might encounter errors.
# You can download version v1.48.0 at https://github.com/golangci/golangci-lint/releases/tag/v1.48.0
.PHONY: lint
lint:
$(GOLANGCI_LINT) run --timeout=20m
Expand All @@ -295,7 +295,7 @@ MODFILES := $(shell find . -name go.mod)
define modtidy-target
.PHONY: modtidy-$(1)
modtidy-$(1):
cd $(shell dirname $(1)); go mod tidy -compat=1.18; cd -
cd $(shell dirname $(1)); go mod tidy -compat=1.19; cd -
endef

# Generate modtidy target action for each go.mod file
Expand Down
Loading

0 comments on commit 032581d

Please sign in to comment.