Skip to content

nil pointer dereference #622

Closed
Closed
@yaches

Description

@yaches

Running linter in gilab ci
golangci-lint:v1.17
go 1.12

err log:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x99471f]

goroutine 3142 [running]:
github.com/golangci/golangci-lint/vendor/github.com/timakin/bodyclose/passes/bodyclose.(*runner).run(0xc0000bcc40, 0xc0231add60, 0x10, 0xd1d9e0, 0x1d7, 0x1d8)
	/home/travis/gopath/src/github.com/golangci/golangci-lint/vendor/github.com/timakin/bodyclose/passes/bodyclose/bodyclose.go:57 +0x1af
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker.(*action).execOnce(0xc01c98a8c0)
	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker/checker.go:382 +0x68a
sync.(*Once).Do(0xc01c98a8c0, 0xc0003fc790)
	/home/travis/.gimme/versions/go1.12.5.linux.amd64/src/sync/once.go:44 +0xb3
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker.(*action).exec(0xc01c98a8c0)
	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker/checker.go:303 +0x50
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker.execAll.func1(0xc01c98a8c0)
	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker/checker.go:291 +0x34
created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker.execAll
	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker/checker.go:297 +0x11b
Makefile:56: recipe for target 'lint' failed
make: *** [lint] Error 2

.golangci.yml:

linters:
  enable-all: true
  disable:
    # Globals are OK
    - gochecknoglobals
    # So are inits
    - gochecknoinits
    # Cant disable some of go vet checks => disable all of them
    - govet
    # Useless
    - interfacer
    # Long lines are fine
    - lll
    # Using "weak" primitivies is fine when they're not used for crypto
    - gosec

run:
  tests: false
  issues-exit-code: 0
  skip-dirs:
    - vendor/
  skip-files:
    - _test.go

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions