mirror of
https://github.com/golang/go
synced 2024-11-18 14:54:40 -07:00
internal/lsp/cache: fix ineffectual err assignment
The `if err :=` block creates a shadow err value that is then discarded after the block. Change-Id: I78f6a7298ac5d3d86ece056a9e328bcee9fdc683 Change-Id: I78f6a7298ac5d3d86ece056a9e328bcee9fdc683 GitHub-Last-Rev: 4bac8fb982fa3a0724206422b1a4dbc5e41c34a9 GitHub-Pull-Request: golang/tools#114 Reviewed-on: https://go-review.googlesource.com/c/tools/+/181777 Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Cottrell <iancottrell@google.com>
This commit is contained in:
parent
97de5656fd
commit
7653e6d3d5
3
internal/lsp/cache/parse.go
vendored
3
internal/lsp/cache/parse.go
vendored
@ -232,7 +232,8 @@ func fix(ctx context.Context, file *ast.File, tok *token.File, src []byte) error
|
||||
}
|
||||
switch n := n.(type) {
|
||||
case *ast.BadStmt:
|
||||
if err := parseDeferOrGoStmt(n, parent, tok, src); err != nil {
|
||||
err = parseDeferOrGoStmt(n, parent, tok, src) // don't shadow err
|
||||
if err != nil {
|
||||
err = fmt.Errorf("unable to parse defer or go from *ast.BadStmt: %v", err)
|
||||
}
|
||||
return false
|
||||
|
Loading…
Reference in New Issue
Block a user