Skip to content

structcheck returns false positives for embedded structs #826

Closed
@valyala

Description

@valyala

Thank you for creating the issue!

  • 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 --version
golangci-lint has version v1.21.0 built from (unknown, mod sum: "h1:HxAxpR8Z0M8omihvQdsD3PF0qPjlqYqp2vMJzstoKeI=") on (unknown)
Config file
$ cat .golangci.yml
cat: .golangci.yml: No such file or directory
Go environment
$ go version && go env
go version go1.13.1 linux/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/valyala/.cache/go-build"
GOENV="/home/valyala/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/valyala/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/valyala/work/go-src"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/valyala/work/go-src/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/valyala/work/VictoriaMetrics/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-build974883207=/tmp/go-build -gno-record-gcc-switches"

See false positives here: https://github.com/VictoriaMetrics/VictoriaMetrics/commit/97ce4e03a57825a783a28e25fc88b9a9e9e09c3c/checks?check_suite_id=269491276

Metadata

Metadata

Assignees

No one assigned

    Labels

    false positiveAn error is reported when one does not exist

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions