Please include the following information:
golangci-lint --version (or git commit if you don't use binary distribution)golangci-lint --version
golangci-lint has version 1.16.0 built from 97ea1cb on 2019-03-31T19:49:30Z
cat .golangci.ymlrun:
concurrency: 12
tests: false
skip-dirs:
# - internal/protobuf/
skip-files:
- .*test_client_lib\\.*.go
linters:
enable:
- govet #Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
- errcheck #Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
- staticcheck #Staticcheck is a go vet on steroids, applying a ton of static analysis checks
- unused #Checks Go code for unused constants, variables, functions and types
- gosimple #Linter for Go source code that specializes in simplifying a code
- structcheck #Finds an unused struct fields
- varcheck #Finds unused global variables and constants
- ineffassign #Detects when assignments to existing variables are not used
- deadcode #Finds unused code
- typecheck #Like the front-end of a Go compiler, parses and type-checks Go code
- golint #Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes
- stylecheck #Stylecheck is a replacement for golint
- gosec #Inspects source code for security problems
- interfacer #Linter that suggests narrower interface types
- unconvert #Remove unnecessary type conversions
- dupl #Tool for code clone detection
- goconst #Finds repeated strings that could be replaced by a constant
# - gocyclo #Computes and checks the cyclomatic complexity of functions
- gofmt #Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
- goimports #Goimports does everything that gofmt does. Additionally it checks unused imports
- maligned #Tool to detect Go structs that would take less memory if their fields were sorted
- depguard #Go linter that checks if package imports are in a list of acceptable packages
- misspell #Finds commonly misspelled English words in comments
# - lll #Reports long lines
- unparam #Reports unused function parameters
- nakedret #Finds naked returns in functions greater than a specified function length
- prealloc #Finds slice declarations that could potentially be preallocated
- scopelint #Scopelint checks for unpinned variables in go programs
- gocritic #The most opinionated Go source code linter
# - gochecknoinits #Checks that no init functions are present in Go code
# - gochecknoglobals #Checks that no globals are present in Go code
issues:
# Not using default exclusions because we want to require comments on public
# functions and types.
exclude-use-default: false
exclude:
# errcheck: Almost all programs ignore errors on these functions and in most cases it's ok
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked
# golint: False positive when tests are defined in package 'test'
- func name will be used as test\.Test.* by other packages, and that stutters; consider calling this
# govet: Common false positives
- (possible misuse of unsafe.Pointer|should have signature)
- should have comment or be unexported
- comment on exported `.*?` should be of the form
- don't use an underscore in package name
go version && go envgo version
go version go1.12.4 windows/amd64
go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\alekc\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\alekc\go
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\alekc\go\src\company.com\projectx\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\alekc\AppData\Local\Temp\go-build335245370=/tmp/go-build -gno-rec
ord-gcc-switches
md5-44e38da5e043a026c3f69c1d81994dbe
golangci-lint run -v
level=info msg="[config_reader] Config search paths: [./ C:\\Users\\alekc\\go\\src\\company.com\\projectx\\internal\\controllers\\item_controller C:\\Users\\alekc\\go\\src\\company.com\\projectx\\internal\\controllers C:\\Users\\alekc\\go\\src\\company.com\\projectx\\internal C:\\Users\\alekc\\go\\src\\company.com\\projectx C:\\Users\\alekc\\go\\src\\company.com C:\\Users\\alekc\\go\\src C:\\Users\\alekc\\go C:\\Users\\alekc C:\\Users C:\\]"
level=info msg="[config_reader] Used config file ..\\..\\..\\.golangci.yml"
level=info msg="[lintersdb] Active 27 linters: [deadcode depguard dupl errcheck goconst gocritic gofmt goimports golint gosec gosimple govet ineffassign interfacer maligned misspell nakedret prealloc scopelint staticcheck structcheck stylecheck typecheck unconvert unparam unused varcheck]"
level=info msg="[lintersdb] Optimized sublinters [staticcheck gosimple unused stylecheck] into metalinter megacheck"
level=info msg="[loader] Go packages loading at mode load deps types and syntax took 1.3285863s"
level=info msg="[loader] SSA repr building timing: packages building 10.9121ms, total 87.7926ms"
level=info msg="[loader] Packages that do not compile: [company.com/projectx/internal/controllers/item_controller]"
level=warning msg="[runner/megacheck]sell.go:68 C:2: an't run megachCeck because of compilation errors in packages [company.com/projectx/internal/controllers/item_controller]: C:\\Users\\alekc\\go\\src\\company.com\\projectx\\internal\\controllers\\item_controller\\build_acquireonsider _parpreallocating `itemsToSellList` (prealloc)
var itemt.sgToo:Se1:l lCL:ist [\\User]sw\w\saelrevkecr\.\Igtoe\m\Isnrtce\r\f5a5cpe
ixels.com\\ww se^rve
r\\biunternal\\controllers\ild_acquire_part.go:73\it:e2m5_:c ontsrtorlilnegr \`\not buildable` has b4 occurrences, make it au yc.ognos:t1a1n:t2: (gcooculdonst)
not import github.com/prometheus/common respo/nlsoe.Std.Errgo r( i=n valid "pnaoctk abguei lndaabmlee: \"\""
)"
l e v e l = i n f o m s g = " [ r u n n e r] ^work
er.9b utiolod_ka c1.4qui8re7_3pmas with rstages: prealloct:. g9o9:25碌s, errch8ec:25: k: s4t9r5i.n3碌s, unconvert:g `D0Bs, pvaarrtcsh`e chka:s 04s ,o cncaukrerdernecte:s ,0s "m
aklee vietl =ai ncfoon smtsagn=t"[r u(ngnoecro]n swto)r
ke r . 5re stpooonks e.8S7t.d2.9E5r2rmosr w=i t"hD Bs tpaagretss:"
in e f f a s si g n : 8 6 . 3 0 3 2 m s , s c ope^lin
t: 9b9u2i碌lsd,_ agcoqcuriirtei_cp:a r0ts."g
o:l6e6vel:=2i5n:f o msstgr=i"n[gr u`nDnBe rp]r owgorreksesr`. 1h2a st o4o ko c9c2u.r7r5e1n3cmess ,w imtahk es tiatg eas :c ognosftmatn:t 92 .(7g5o1c3omnss"t
)
le v e lr=eisnpfoon smes.gS=t"d[.rEurnrnoerr ]= w"oDrBk eprr.o4g rteososk"
14 1 . 3 5 9 m s w i t h s t a g e s : m i ssp^ell
: 14t1.ype_l3i5s9tm.sg,o :d2e2pgu:a1r:d : 0cso"m
melnetv eoln= eerxrpoorr tmesdg =f"u[nrcutninoner/ty p`eTcyhpeecLki]s tt`y psehcohuelcdk ibneg oef rtrhoer :f oCr:m\ \`UTsyepresL\i\satl e.k.c.\`\go \(\gsorlci\n\t5)5
pi/x/ePllsa.cec oamn\ \iwtwesme rivne ra\ \rionotme,r noarl \i\nc otnhter oilnlveernst\o\riyt
em_c^ont
roller\\buy.go:11:2: could not import github.com/prometheus/common/log (invalid package name: \"\")"
level=info msg="[runner] worker.8 took 172.6068ms with stages: megacheck: 172.6068ms"
level=info msg="[runner] worker.7 took 159.2152ms with stages: golint: 159.2152ms"
level=info msg="[runner] worker.2 took 161.6947ms with stages: goimports: 161.6947ms"
level=info msg="[runner] worker.6 took 63.487ms with stages: interfacer: 63.487ms"
level=info msg="[runner] worker.10 took 174.5908ms with stages: dupl: 174.5908ms"
level=info msg="[runner] worker.3 took 96.7189ms with stages: unparam: 96.7189ms"
level=warning msg="[runner/govet] govet error: assign: analysis skipped due to errors in package"
level=info msg="[runner] worker.11 took 220.7185ms with stages: typecheck: 219.7265ms, goconst: 496.7碌s, gosec: 495.3碌s, structcheck: 0s, deadcode: 0s, maligned: 0s"
level=warning msg="[runner/govet] govet error: atomicalign: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: bools: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: buildtag: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: httpresponse: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: loopclosure: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: ctrlflow: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/sirupsen/logrus"
level=warning msg="[runner/govet] govet error: ctrlflow: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx, [email protected]/davecgh/go-spew/spew, [email protected]/sirupsen/logrus"
level=warning msg="[runner/govet] govet error: ctrlflow: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: ctrlflow: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx/internal/logger, [email protected]/spf13/viper, [email protected]/go/db"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx/internal/lib/util, [email protected]/go/db"
level=warning msg="[runner/govet] govet error: ctrlflow: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger, [email protected]/go-sql-driver/mysql"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/db/model/item_type, [email protected]/projectx/internal/logger, [email protected]/go-sql-driver/mysql"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/db/model/item, [email protected]/projectx/internal/db/model/item_type, [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx/internal/lib/util"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/db/model/leaderboard_model, [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx/internal/lib/util"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/db/model/key_value, [email protected]/projectx/internal/db/model/leaderboard_model, [email protected]/projectx/internal/games/leaderboard, [email protected]/projectx/internal/lib/leaky_bucket, [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/db/model/key_value, [email protected]/projectx/internal/db/model/nest/nest_room, [email protected]/projectx/internal/lib/leaky_bucket, [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger"
level=warning msg="[runner/govet] govet error: ctrlflow: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger, [email protected]/streadway/amqp"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/logger"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/go-sql-driver/mysql"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx/internal/db/model"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx/internal/db/model, [email protected]/projectx/internal/lib/level, [email protected]/projectx/internal/logger"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/db/model/friendship, [email protected]/projectx/internal/db/model/item/item_manager, [email protected]/projectx/internal/db/model/key_value, [email protected]/projectx/internal/db/model/nest, [email protected]/projectx/internal/lib/email, [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger, [email protected]/projectx/internal/network, [email protected]/projectx/internal/static, [email protected]/go-sql-driver/mysql, [email protected]/go/db"
level=warning msg="[runner/govet] govet error: ctrlflow: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx/internal/logger, [email protected]/tbalthazar/onesignal-go"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/db/model/nest, [email protected]/projectx/internal/db/model/wv"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/db/model/wv, [email protected]/projectx/internal/lib/app_notifications, [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger, [email protected]/projectx/internal/network, [email protected]/projectx/internal/protobuf/notifications"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx/internal/db/model/conversation, [email protected]/projectx/internal/db/model/leaderboard_model, [email protected]/projectx/internal/db/model/wv, [email protected]/projectx/internal/games/leaderboard, [email protected]/projectx/internal/lib/util, [email protected]/go-sql-driver/mysql"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/db/model/key_value, [email protected]/projectx/internal/db/model/nest, [email protected]/projectx/internal/db/model/wv, [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger, [email protected]/projectx/internal/network, [email protected]/projectx/internal/protobuf/notifications"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx/internal/db/model/key_value"
level=warning msg="[runner/govet] govet error: ctrlflow: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger, [email protected]/pkg/errors"
level=warning msg="[runner/govet] govet error: ctrlflow: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: ctrlflow: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: ctrlflow: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: ctrlflow: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/go-kit/kit/metrics, [email protected]/go-kit/kit/metrics/prometheus, [email protected]/prometheus/client_golang/prometheus, [email protected]/prometheus/client_golang/prometheus/promhttp"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx/internal/protobuf/notifications"
level=warning msg="[runner/govet] govet error: ctrlflow: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: ctrlflow: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/db/model/conversation, [email protected]/projectx/internal/db/model/gift, [email protected]/projectx/internal/db/model/item, [email protected]/projectx/internal/db/model/item/item_manager, [email protected]/projectx/internal/db/model/item_type, [email protected]/projectx/internal/db/model/nest, [email protected]/projectx/internal/db/model/wv, [email protected]/projectx/internal/lib/collection, [email protected]/projectx/internal/lib/daily_task, [email protected]/projectx/internal/lib/signature, [email protected]/projectx/internal/lib/swift, [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger, [email protected]/projectx/internal/metrics, [email protected]/projectx/internal/network, [email protected]/projectx/internal/protobuf/notifications, [email protected]/projectx/internal/protobuf/responses, [email protected]/prometheus/common/log"
level=warning msg="[runner/govet] govet error: lostcancel: failed prerequisites: [email protected]/projectx/internal/controllers/item_controller"
level=warning msg="[runner/govet] govet error: nilfunc: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: printf: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/sirupsen/logrus"
level=warning msg="[runner/govet] govet error: printf: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx, [email protected]/davecgh/go-spew/spew, [email protected]/sirupsen/logrus"
level=warning msg="[runner/govet] govet error: printf: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: printf: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx/internal/logger, [email protected]/spf13/viper, [email protected]/go/db"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx/internal/lib/util, [email protected]/go/db"
level=warning msg="[runner/govet] govet error: printf: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger, [email protected]/go-sql-driver/mysql"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/db/model/item_type, [email protected]/projectx/internal/logger, [email protected]/go-sql-driver/mysql"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/db/model/item, [email protected]/projectx/internal/db/model/item_type, [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx/internal/lib/util"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/db/model/leaderboard_model, [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx/internal/lib/util"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/db/model/key_value, [email protected]/projectx/internal/db/model/leaderboard_model, [email protected]/projectx/internal/games/leaderboard, [email protected]/projectx/internal/lib/leaky_bucket, [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/db/model/key_value, [email protected]/projectx/internal/db/model/nest/nest_room, [email protected]/projectx/internal/lib/leaky_bucket, [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger"
level=warning msg="[runner/govet] govet error: printf: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger, [email protected]/streadway/amqp"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/logger"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/go-sql-driver/mysql"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx/internal/db/model"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx/internal/db/model, [email protected]/projectx/internal/lib/level, [email protected]/projectx/internal/logger"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/db/model/friendship, [email protected]/projectx/internal/db/model/item/item_manager, [email protected]/projectx/internal/db/model/key_value, [email protected]/projectx/internal/db/model/nest, [email protected]/projectx/internal/lib/email, [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger, [email protected]/projectx/internal/network, [email protected]/projectx/internal/static, [email protected]/go-sql-driver/mysql, [email protected]/go/db"
level=warning msg="[runner/govet] govet error: printf: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx/internal/logger, [email protected]/tbalthazar/onesignal-go"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/db/model/nest, [email protected]/projectx/internal/db/model/wv"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/db/model/wv, [email protected]/projectx/internal/lib/app_notifications, [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger, [email protected]/projectx/internal/network, [email protected]/projectx/internal/protobuf/notifications"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx/internal/db/model/conversation, [email protected]/projectx/internal/db/model/leaderboard_model, [email protected]/projectx/internal/db/model/wv, [email protected]/projectx/internal/games/leaderboard, [email protected]/projectx/internal/lib/util, [email protected]/go-sql-driver/mysql"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/db/model/key_value, [email protected]/projectx/internal/db/model/nest, [email protected]/projectx/internal/db/model/wv, [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger, [email protected]/projectx/internal/network, [email protected]/projectx/internal/protobuf/notifications"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx/internal/db/model/key_value"
level=warning msg="[runner/govet] govet error: printf: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger, [email protected]/pkg/errors"
level=warning msg="[runner/govet] govet error: printf: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: printf: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: printf: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: printf: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/go-kit/kit/metrics, [email protected]/go-kit/kit/metrics/prometheus, [email protected]/prometheus/client_golang/prometheus, [email protected]/prometheus/client_golang/prometheus/promhttp"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx/internal/protobuf/notifications"
level=warning msg="[runner/govet] govet error: printf: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: printf: failed prerequisites: [email protected]/projectx, [email protected]/projectx/internal/db/model/conversation, [email protected]/projectx/internal/db/model/gift, [email protected]/projectx/internal/db/model/item, [email protected]/projectx/internal/db/model/item/item_manager, [email protected]/projectx/internal/db/model/item_type, [email protected]/projectx/internal/db/model/nest, [email protected]/projectx/internal/db/model/wv, [email protected]/projectx/internal/lib/collection, [email protected]/projectx/internal/lib/daily_task, [email protected]/projectx/internal/lib/signature, [email protected]/projectx/internal/lib/swift, [email protected]/projectx/internal/lib/util, [email protected]/projectx/internal/logger, [email protected]/projectx/internal/metrics, [email protected]/projectx/internal/network, [email protected]/projectx/internal/protobuf/notifications, [email protected]/projectx/internal/protobuf/responses, [email protected]/prometheus/common/log"
level=warning msg="[runner/govet] govet error: shift: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: stdmethods: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: tests: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: unmarshal: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: unsafeptr: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: unusedresult: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: buildssa: analysis skipped due to errors in package"
level=warning msg="[runner/govet] govet error: nilness: failed prerequisites: [email protected]/projectx/internal/controllers/item_controller"
level=info msg="[runner] worker.1 took 872.6978ms with stages: govet: 872.6978ms"
level=warning msg="[runner] Can't run linter govet: asmdecl: analysis skipped due to errors in package"
level=info msg="[runner] Issues before processing: 37, after processing: 5"
level=info msg="[runner] processing took 3.9672ms with stages: autogenerated_exclude: 992碌s, source_code: 991.6碌s, identifier_marker: 991.4碌s, cgo: 496.1碌s, exclude: 496.1碌s, skip_files: 0s, max_same_issues: 0s, path_prettifier: 0s, diff: 0s, uniq_by_line: 0s, nolint: 0s, max_per_file_from_linter: 0s, max_from_linter: 0s, replacement_builder: 0s, path_shortener: 0s, skip_dirs: 0s, exclude-rules: 0s"
level=info msg="[runner] Workers idle times: #2: 647.9915ms, #3: 641.0475ms, #4: 668.3275ms, #5: 678.7432ms, #6: 646.0076ms, #7: 650.4713ms, #8: 653.4476ms, #9: 686.1834ms, #10: 643.0311ms, #11: 633.6078ms, #12: 674.2797ms"
level=info msg="File cache stats: 3 entries of total size 13.4KiB"
level=info msg="Memory: 26 samples, avg is 300.6MB, max is 555.7MB"
level=info msg="Execution took 2.4071188s"
md5-9698aaef045608cc08c3af540dddcc6a
import (
...
"github.com/prometheus/common/log"
...
md5-6d0da6aa0ede174c92925a5b0f2482ca
could not import github.com/sirupsen/logrus (invalid package name: \"\")"
could not import github.com/davecgh/go-spew/spew (invalid package name: \"\")"
could not import github.com/spf13/viper (invalid package name: \"\")"
And there is always
level=warning msg="[runner/megacheck] Can't run megacheck because of compilation errors in packages [command-line-arguments]:
The behaviour is present even on the latest branch version (as of 25/04)
Tried the same project on another windows machine and its working fine :/
golangci-lint --version
golangci-lint has version v1.16.0 built from (unknown, mod sum: "h1:PcWAN9JHflZzJQaZVY1JXZE0Tgjq+jO2v4QLqJ/Azvw=") on (unknown)
go version
go version go1.12.4 windows/amd64
C:\Users\alekc>go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\alekc\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\alekc\go
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\alekc\AppData\Local\Temp\go-build859428150=/tmp/go-build -gno-record-gcc-switches
I have encountered the same (or at least a very similar) problem:
main.go:9:11: could not import github.com/sirupsen/logrus (invalid package name: "") (typecheck)
Versions:
go version go1.12 linux/amd64692dacb773b703162c091c2d8c59f9cd2d6801dbI encountered this error, too.
But when I executed: GO111MODULE=on go mod vendor, then golangci-lint run again, the error was disappeared.
I think cause the golangci-lint looked for package paths in vendor directory in case of go module, instead of GOPATH.
I have faced the same problem. However, @manhdaovan approach do help. But I think this is still an error. Please take a look.
https://github.com/golangci/golangci-lint/issues/516#issuecomment-512674357
Or if you run: GO111MODULE=on golangci-lint run, the error was disappeared without vendor.
Most helpful comment
I encountered this error, too.
But when I executed:
GO111MODULE=on go mod vendor, thengolangci-lint runagain, the error was disappeared.I think cause the
golangci-lintlooked for package paths invendordirectory in case of go module, instead of GOPATH.