Skip to content

cmd/vet,x/tools/go/analysis/passes/printf: false positive on "does not support error-wrapping directive %w" on Sprintf-and-Errorf-wrapper #77638

@ernado

Description

@ernado

Go version

1.26.0

Output of go env in your module/workspace:

AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/runner/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/runner/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2340511584=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/home/runner/work/td/td/go.mod'
GOMODCACHE='/home/runner/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/runner/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/hostedtoolcache/go/1.26.0/x64'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/runner/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/opt/hostedtoolcache/go/1.26.0/x64/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.26.0'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

go test ./...

What did you see happen?

Error: session/tdesktop/mtp_dcoptions.go:121:42: github.com/go-faster/errors.Errorf does not support error-wrapping directive %w
# github.com/gotd/td/telegram/message/internal/mkrun
Error: telegram/message/internal/mkrun/mkrun.go:49:32: github.com/go-faster/errors.Errorf does not support error-wrapping directive %w
Error: telegram/message/internal/mkrun/mkrun.go:56:34: github.com/go-faster/errors.Errorf does not support error-wrapping directive %w
Error: telegram/message/internal/mkrun/mkrun.go:62:33: github.com/go-faster/errors.Errorf does not support error-wrapping directive %w
Error: telegram/message/internal/mkrun/mkrun.go:66:32: github.com/go-faster/errors.Errorf does not support error-wrapping directive %w

What did you expect to see?

No error, as github.com/go-faster/errors#Errorf supports error-wrapping directive.

How to reproduce

Use https://github.com/ernado/go-issue-77638

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions