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/gopls: too verbose message in diagnostic for go.mod #41462

Open
leitzler opened this issue Sep 17, 2020 · 0 comments
Open

x/tools/gopls: too verbose message in diagnostic for go.mod #41462

leitzler opened this issue Sep 17, 2020 · 0 comments
Labels
Milestone

Comments

@leitzler
Copy link
Contributor

@leitzler leitzler commented Sep 17, 2020

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

$ go version
go version devel +93810ac Thu Sep 3 22:08:58 2020 +0000 darwin/amd64

golang.org/x/tools v0.0.0-20200916122506-6ec2cde9631b
golang.org/x/tools/gopls v0.0.0-20200916122506-6ec2cde9631b

What did you do?

With tempmod enabled I opened up a go file in github.com/govim/govim and added a new import, github.com/moby/moby/api (to intentionally introduce an error).

What did you expect to see?

A less noisy diagnostic message.

As per Slack conversation with Heschi it looks like the error is parsed but the relevant text isn't extracted.

What did you see instead?

A super long and verbose message:

PublishDiagnostics callback: &protocol.PublishDiagnosticsParams{
    URI:         "file:///Users/leitzler/proj/govim/go.mod",
    Version:     8,
    Diagnostics: {
        {
            Range: protocol.Range{
                Start: protocol.Position{},
                End:   protocol.Position{Line:0, Character:29},
            },
            Severity:           1,
            Code:               nil,
            Source:             "",
            Message:            "go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -mod=mod -modfile=/var/folders/j4/l2j99h6d5qd6knjlllql0bb80000gn/T/go.0535739845085bcd81322001a4009bf7933c87445ac818639dc283b06ce34f90.635768216.mod -- github.com/moby/moby/api]: exit status 1: go: finding module for package github.com/moby/moby/api\ngo: found github.com/moby/moby/api in github.com/moby/moby v1.13.1\ngo: finding module for package github.com/docker/docker/api/types\ngo: finding module for package github.com/docker/docker/pkg/ioutils\ngo: finding module for package github.com/Sirupsen/logrus\ngo: finding module for package github.com/docker/docker/pkg/system\ngo: finding module for package github.com/docker/libtrust\ngo: found github.com/Sirupsen/logrus in github.com/Sirupsen/logrus v1.6.0\ngo: found github.com/docker/docker/api/types in github.com/docker/docker v1.13.1\ngo: found github.com/docker/docker/pkg/ioutils in github.com/docker/docker v1.13.1\ngo: found github.com/docker/docker/pkg/system in github.com/docker/docker v1.13.1\ngo: found github.com/docker/libtrust in github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7\ngo: github.com/moby/moby/api imports\n\tgithub.com/Sirupsen/logrus: github.com/Sirupsen/logrus@v1.6.0: parsing go.mod:\n\tmodule declares its path as: github.com/sirupsen/logrus\n\t        but was required as: github.com/Sirupsen/logrus\n: packages.Load error",
            Tags:               nil,
            RelatedInformation: nil,
        },
    },
}
@gopherbot gopherbot added this to the Unreleased milestone Sep 17, 2020
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v1.0.0 Sep 17, 2020
@stamblerre stamblerre added this to Bugs in gopls/v1.0.0 Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Linked pull requests

Successfully merging a pull request may close this issue.

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