Skip to content

x/tools/gopls: multiple errors for a single instance of 'no new variables' #67961

Closed as not planned
@rsc

Description

@rsc

What did you do?

% cat x.go
package main

func f() (x, y, z int) {
	x, y := 1, 2
	return
}
% gopls check x.go
Log: Loading packages...
Info: Finished loading packages.
Log: Running...
Info: completed
/Users/rsc/src/rsc.io/gaby/x.go:4:2-14: no new variables on left side of :=
/Users/rsc/src/rsc.io/gaby/x.go:4:7: no new variables on left side of :=
% 

What did you expect to see?

One error.

What did you see instead?

Two errors.

Build info

My x/tools is at golang/tools@7045d2e.

golang.org/x/tools/gopls (devel)
    golang.org/x/tools/gopls@(devel)
    github.com/BurntSushi/[email protected] h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
    github.com/google/[email protected] h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
    golang.org/x/exp/[email protected] h1:2O2DON6y3XMJiQRAS1UWU+54aec2uopH3x7MAiqGW6Y=
    golang.org/x/[email protected] h1:EfMABMgrJ8+hRjLvhUzJkLKgFv3lYAglGXczg5ggNyk=
    golang.org/x/[email protected] h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
    golang.org/x/[email protected] h1:zf5N6UOrA487eEFacMePxjXAJctxKmyjKUsjA11Uzuk=
    golang.org/x/[email protected] h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
    golang.org/x/[email protected] => ../
    golang.org/x/[email protected] h1:SP0mPeg2PmGCu03V+61EcQiOjmpri2XijexKdzv8Z1I=
    honnef.co/go/[email protected] h1:9MDAWxMoSnB6QoSqiVr7P5mtkT9pOc1kSxchzPCnqJs=
    mvdan.cc/[email protected] h1:G3QvahNDmpD+Aek/bNOLrFR2XC6ZAdo62dZu65gmwGo=
    mvdan.cc/xurls/[email protected] h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8=
go: devel go1.23-d79f51bb9c Sat May 25 14:34:55 2024 -0400

Metadata

Metadata

Assignees

No one assigned

    Labels

    ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions