Skip to content

Strange govet issue #600

Closed
Closed
@mantzas

Description

@mantzas
golangci-lint run -E golint --exclude-use-default=false --build-tags integration
WARN [runner] Can't process result by autogenerated_exclude processor: can't filter issue result.Issue{FromLinter:"govet", Text:"nilness: nil dereference in index operation", Pos:token.Position{Filename:"", Offset:0, Line:0, Column:0}, LineRange:(*result.Range)(nil), HunkPos:0, SourceLines:[]string(nil), Replacement:(*result.Replacement)(nil)}: no file path for issue 
WARN [runner] Can't process result by nolint processor: can't filter issue result.Issue{FromLinter:"govet", Text:"nilness: nil dereference in index operation", Pos:token.Position{Filename:"", Offset:0, Line:0, Column:0}, LineRange:(*result.Range)(nil), HunkPos:0, SourceLines:[]string(nil), Replacement:(*result.Replacement)(nil)}: no file path for issue 
WARN [runner/source_code] Failed to get line 0 for file : failed to get file  lines cache: can't get file  bytes from cache: can't read file : open : no such file or directory 

Thank you for creating the issue!

Please include the following information:

  1. Version of golangci-lint: golangci-lint --version (or git commit if you don't use binary distribution) : 1.17.1
  2. Config file: cat .golangci.yml: N/A
  3. Go environment: go version && go env

go version go1.12.6 linux/amd64

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/{...}/.cache/go-build"
GOEXE=""
GOFLAGS=" -mod=vendor"
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/{...}/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/{...}/src/go/neat/tems/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-build276631786=/tmp/go-build -gno-record-gcc-switches"
  1. Verbose output of running: golangci-lint run -v
INFO [config_reader] Config search paths: [./ /home/{...}/src/go/neat/tems /home/{...}/src/go/neat /home/{...}/src/go /home/{...}/src /home/{...} /home /] 
INFO [lintersdb] Active 10 linters: [deadcode errcheck gosimple govet ineffassign staticcheck structcheck typecheck unused varcheck] 
INFO [lintersdb] Optimized sublinters [staticcheck gosimple unused] into metalinter megacheck 
INFO [loader] Go packages loading at mode load types and syntax took 1.133591951s 
INFO [loader] SSA repr building timing: packages building 20.810013ms, total 210.706927ms 
INFO [runner] worker.16 took 1.14µs               
INFO [runner] worker.10 took 961ns                
INFO [runner] worker.12 took 1.08µs               
INFO [runner] worker.14 took 3.42µs               
INFO [runner] worker.1 took 1.17µs                
INFO [runner] worker.9 took 4.2µs                 
INFO [runner] worker.4 took 2.98µs                
INFO [runner] worker.13 took 2.85µs               
INFO [runner] worker.7 took 2.02µs                
INFO [runner] worker.8 took 1.478061ms with stages: errcheck: 1.471921ms 
INFO [runner] worker.6 took 6.237966ms with stages: structcheck: 6.228596ms 
INFO [runner] worker.3 took 18.400685ms with stages: deadcode: 18.391465ms 
INFO [runner] worker.15 took 19.747745ms with stages: varcheck: 19.723205ms, typecheck: 14.19µs 
INFO [runner] worker.11 took 57.685543ms with stages: ineffassign: 57.679583ms 
INFO [runner] worker.2 took 234.735535ms with stages: govet: 234.726715ms 
WARN [runner] Can't process result by autogenerated_exclude processor: can't filter issue result.Issue{FromLinter:"govet", Text:"nilness: nil dereference in index operation", Pos:token.Position{Filename:"", Offset:0, Line:0, Column:0}, LineRange:(*result.Range)(nil), HunkPos:0, SourceLines:[]string(nil), Replacement:(*result.Replacement)(nil)}: no file path for issue 
WARN [runner] Can't process result by nolint processor: can't filter issue result.Issue{FromLinter:"govet", Text:"nilness: nil dereference in index operation", Pos:token.Position{Filename:"", Offset:0, Line:0, Column:0}, LineRange:(*result.Range)(nil), HunkPos:0, SourceLines:[]string(nil), Replacement:(*result.Replacement)(nil)}: no file path for issue 
WARN [runner/source_code] Failed to get line 0 for file : failed to get file  lines cache: can't get file  bytes from cache: can't read file : open : no such file or directory 
:0: nilness: nil dereference in index operation (govet)
INFO [runner] worker.5 took 1.066030115s with stages: megacheck: 1.066022024s 
INFO [runner] Workers idle times: #1: 1.065837993s, #2: 831.278909ms, #3: 1.047545469s, #4: 1.065814103s, #6: 1.059681348s, #7: 1.065746742s, #8: 1.064520683s, #9: 1.065826873s, #10: 1.065894633s, #11: 1.00829602s, #12: 1.065880933s, #13: 1.065802183s, #14: 1.065871163s, #15: 1.046017517s, #16: 1.065944914s 
INFO [runner] processing took 1.008227ms with stages: exclude: 396.424µs, skip_dirs: 190.991µs, identifier_marker: 178.631µs, source_code: 67.38µs, autogenerated_exclude: 59.82µs, cgo: 33.541µs, nolint: 26.49µs, path_prettifier: 15.95µs, max_same_issues: 8.74µs, filename_unadjuster: 6.35µs, max_from_linter: 6.28µs, uniq_by_line: 5.8µs, path_shortener: 5.02µs, max_per_file_from_linter: 4.74µs, diff: 970ns, skip_files: 600ns, exclude-rules: 500ns 
pkg/microrule/config/consul/client_test.go:59:6: U1000: func `TryDeleteKey` is unused (unused)
func TryDeleteKey(t *testing.T, client *Client, key string) {
     ^
pkg/microrule/config/consul/client_test.go:68:6: U1000: func `TryDeletePrefix` is unused (unused)
func TryDeletePrefix(t *testing.T, client *Client, key string) {
     ^
pkg/microrule/config/consul/client_test.go:77:6: U1000: func `TryPutValue` is unused (unused)
func TryPutValue(t *testing.T, client *Client, key string, value []byte) {
     ^
pkg/microrule/config/consul/client_test.go:90:6: U1000: func `TryPutChunkedValueTransact` is unused (unused)
func TryPutChunkedValueTransact(t *testing.T, client *Client, prefix string, data []byte, nbChunks uint) {
     ^
pkg/microrule/config/consul/client_test.go:102:6: U1000: func `chunkSlice` is unused (unused)
func chunkSlice(chunkSize int, slice []byte) [][]byte {
     ^
pkg/microrule/config/consul/client_test.go:111:6: U1000: func `tryPutValuesTransact` is unused (unused)
func tryPutValuesTransact(t *testing.T, client *Client, prefix string, values [][]byte) {
     ^
INFO File cache stats: 1 entries of total size 2.9KiB 
INFO Memory: 26 samples, avg is 564.2MB, max is 1147.9MB 
INFO Execution took 2.455753116s       

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingduplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions