You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
% 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 :=
%
The text was updated successfully, but these errors were encountered:
gopherbot
added
Tools
This label describes issues relating to any tools in the x/tools repository.
gopls
Issues related to the Go language server, gopls.
labels
Jun 13, 2024
In this specific case, one is from compiler and the other is from the nonewvars analyzer.
Does "x/tools/gopls/internal/analysis/nonewvars" still offer a value
if "x/tools/internal/typesinternal" does the check? EDIT: I see. Like #65966, the nonewvars analyzer was to offers fix. In the current gopls architecture, fixes and diagnostics should be exactly paired.
[{
"resource": "main.go",
"owner": "_generated_diagnostic_collection_name_#0",
"code": {
"value": "NoNewVar",
"target": {
"$mid": 1,
"path": "/golang.org/x/tools/internal/typesinternal",
"scheme": "https",
"authority": "pkg.go.dev",
"fragment": "NoNewVar"
}
},
"severity": 8,
"message": "no new variables on left side of :=",
"source": "compiler",
...
}]
[{
"resource": "main.go",
"owner": "_generated_diagnostic_collection_name_#0",
"code": {
"value": "default",
"target": {
"$mid": 1,
"path": "/golang.org/x/tools/gopls/internal/analysis/nonewvars",
"scheme": "https",
"authority": "pkg.go.dev"
}
},
"severity": 4,
"message": "no new variables on left side of :=",
"source": "nonewvars",
...
"tags": [
1
]
}]
What did you do?
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.
The text was updated successfully, but these errors were encountered: