Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/cmd/gopls: badly formatted diagnostics returned #31494

Closed
myitcv opened this issue Apr 16, 2019 · 1 comment
Closed

x/tools/cmd/gopls: badly formatted diagnostics returned #31494

myitcv opened this issue Apr 16, 2019 · 1 comment

Comments

@myitcv
Copy link
Member

@myitcv myitcv commented Apr 16, 2019

What version of Go are you using (go version)?

$ go version
go version go1.12.3 linux/amd64
$ go list -m golang.org/x/tools
golang.org/x/tools v0.0.0-20190406165526-0d5674b3111a

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN="/home/myitcv/gostuff/src/github.com/myitcv/govim/cmd/govim/.bin"
GOCACHE="/home/myitcv/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/myitcv/gostuff"
GOPROXY=""
GORACE=""
GOROOT="/home/myitcv/gos"
GOTMPDIR=""
GOTOOLDIR="/home/myitcv/gos/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/myitcv/gostuff/src/github.com/myitcv/govim/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-build243250984=/tmp/go-build -gno-record-gcc-switches"

What did you do?

The following code:

package main

import "fmt"

func main() {
	fmt.Printf("This is a test %v\n")
}

generates the following diagnostic:

PublishDiagnostics callback: &protocol.PublishDiagnosticsParams{
    URI:         "file:///tmp/go-test-script954767825/script-quickfix/main.go",
    Version:     0,
    Diagnostics: {
        {
            Range: protocol.Range{
                Start: protocol.Position{Line:5, Character:1},
                End:   protocol.Position{Line:5, Character:1},
            },
            Severity:           2,
            Code:               nil,
            Source:             "printf",
            Message:            "Printf format %!v(MISSING) reads arg #1, but call has 0 args",
            Tags:               nil,
            RelatedInformation: nil,
        },
    },
}

What did you expect to see?

The well formatted message:

Printf format "This is a test %v\n" reads arg #1, but call has 0 args

What did you see instead?

The badly formatted message:

Printf format %!v(MISSING) reads arg #1, but call has 0 args

cc @stamblerre @ianthehat

@gopherbot gopherbot added this to the Unreleased milestone Apr 16, 2019
@gopherbot
Copy link

@gopherbot gopherbot commented Apr 16, 2019

Change https://golang.org/cl/172398 mentions this issue: internal/lsp: fix badly formatted error messages from go vet

@golang golang locked and limited conversation to collaborators Apr 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.