You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for maintaining this great tool @bombsimon !
Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
Yes, I've searched similar issues on GitHub and didn't find any.
Yes, I've included all information below (version, config, etc).
Please include the following information:
Version of golangci-lint
$ golangci-lint --versiongolangci-lint has version 1.31.0
Config file
$ cat .golangci.yml
# options for analysis runningrun: # default concurrency is a available CPU number concurrency: 4 # timeout for analysis, e.g. 30s, 5m, default is 1m deadline: 1m skip-files: - mock.go modules-download-mode: vendor
# all available settings of specific linterslinters-settings: errcheck: # report about not checking of errors in type assetions: `a := b.(MyStruct)`; check-type-assertions: true # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; check-blank: true govet: # report about shadowed variables check-shadowing: true gocyclo: # minimal code complexity to report, 30 by default (but we recommend 10-20) min-complexity: 15 lll: # max line length, lines longer will be reported. Default is 120. # '\t' is counted as 1 character by default, and can be changed with the tab-width option line-length: 200 unused: # treat code as a program (not a library) and report unused exported identifiers check-exported: false unparam: # Inspect exported functions, default is false. Set to true if no external program/library imports your code. check-exported: true nakedret: # make an issue if func has more lines of code than this setting and it has naked returns max-func-lines: 60 prealloc: # Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them. simple: true range-loops: true # Report preallocation suggestions on range loops for-loops: false # Report preallocation suggestions on for loopslinters: disable-all: true enable: - govet - errcheck - gocyclo - structcheck - varcheck - ineffassign - deadcode - golint - interfacer - unconvert - goconst - gocyclo - staticcheck - unused - gosimple - dupl - gofmt - gosec - lll - megacheck - gocritic fast: falseissues: # Independently from option `exclude` we use default exclude patterns, # it can be disabled by this option. To list all # excluded by default patterns execute `golangci-lint run --help`. # Default value for this option is true. exclude-use-default: true exclude: - "File is not `goimports`-ed" # TODO fix the following lint checks and remove them from exclude - "hugeParam" - "paramTypeCombine" - "importShadow"
Go environment
$ go version && go envgo 1.14GO111MODULE=""GOARCH="amd64"GOBIN=""GOCACHE="/root/.cache/go-build"GOENV="/root/.config/go/env"GOEXE=""GOFLAGS=""GOHOSTARCH="amd64"GOHOSTOS="linux"GOINSECURE=""GONOPROXY=""GONOSUMDB=""GOOS="linux"GOPATH="/go"GOPRIVATE=""GOPROXY="https://proxy.golang.org,direct"GOROOT="/usr/local/go"GOSUMDB="sum.golang.org"GOTMPDIR=""GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"GCCGO="gccgo"AR="ar"CC="gcc"CXX="g++"CGO_ENABLED="1"GOMOD="/src/go.mod"CGO_CFLAGS="-g -O2"CGO_CPPFLAGS=""CGO_CXXFLAGS="-g -O2"CGO_FFLAGS="-g -O2"CGO_LDFLAGS="-g -O2"PKG_CONFIG="pkg-config"GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build039915949=/tmp/go-build -gno-record-gcc-switches"
Verbose output of running
$ golangci-lint cache clean
$ golangci-lint run -vlevel=warning msg="[runner] Can't run linter goanalysis_metalinter: deadcode: analysis skipped: errors in package: [ /src/kafka/cfg.go:4:17: could not import github.com/confluentinc/confluent-kafka-go/kafka (/src/vendor/github.com/confluentinc/confluent-kafka-go/kafka/00version.go:48:8: could not import C (cgo preprocessing failed)) /src/kafka/consumer.go:17:2: \"github.com/davecgh/go-spew/spew\" imported but not used /src/kafka/consumer.go:8:2: \"strconv\" imported but not used /src/kafka/consumer_channel.go:10:2: \"github.com/prometheus/client_golang/prometheus\" imported but not used /src/kafka/consumer_channel.go:6:2: \"github.com/90poe/service-chassis/streaming/logs\" imported but not used ]"level=warning msg="[runner] Can't run linter unused: buildir: failed to load package kafka: could not load export data: no export data for \"github.com/confluentinc/confluent-kafka-go/kafka\""level=error msg="Running error: buildir: failed to load package kafka: could not load export data: no export data for \"github.com/confluentinc/confluent-kafka-go/kafka\""
I tried the suggestions for this issue #1176 without success.
In docker the lint fails when I run on an alpine (golang:1.14.10-alpine3.12) base image, but succeeds with a Debian base image (golang:1.14.10-buster).
To build the repo under alpine we use go build -tags musl ./..., so I strongly suspect that the error is around must-dev, but I can't work out which file/setting is present in the Debian base image, absent in the Alpine base image.
golangci-lint run --build-tags=musl -c .golangci.yml ./...
this is not working - what this command is doing? I am not able to find .golangci.yml
getting err - ERRO Can't read config: can't read viper config: open .golangci.yml: no such file or directory
Thank you for maintaining this great tool @bombsimon !
Please include the following information:
Version of golangci-lint
Config file
Go environment
Verbose output of running
I tried the suggestions for this issue #1176 without success.
In docker the lint fails when I run on an alpine (golang:1.14.10-alpine3.12) base image, but succeeds with a Debian base image (golang:1.14.10-buster).
To build the repo under alpine we use
go build -tags musl ./...
, so I strongly suspect that the error is aroundmust-dev
, but I can't work out which file/setting is present in the Debian base image, absent in the Alpine base image.The repo uses
The Dockerfile I use is
Makefile
The text was updated successfully, but these errors were encountered: