mirror of
https://github.com/golang/go
synced 2024-11-18 12:14:42 -07:00
cmd/vet: remove (another) dependency on go/astutil
Missed this in a prior change. Change-Id: I7358c17b73a1221cb8f9dff6b808fdea8b13ec06 Reviewed-on: https://go-review.googlesource.com/8916 Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
parent
850ba653f7
commit
14c815ee28
@ -13,7 +13,6 @@ import (
|
|||||||
"go/token"
|
"go/token"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"golang.org/x/tools/go/ast/astutil"
|
|
||||||
"golang.org/x/tools/go/types"
|
"golang.org/x/tools/go/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -56,11 +55,11 @@ func initUnusedFlags() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func checkUnusedResult(f *File, n ast.Node) {
|
func checkUnusedResult(f *File, n ast.Node) {
|
||||||
call, ok := astutil.Unparen(n.(*ast.ExprStmt).X).(*ast.CallExpr)
|
call, ok := unparen(n.(*ast.ExprStmt).X).(*ast.CallExpr)
|
||||||
if !ok {
|
if !ok {
|
||||||
return // not a call statement
|
return // not a call statement
|
||||||
}
|
}
|
||||||
fun := astutil.Unparen(call.Fun)
|
fun := unparen(call.Fun)
|
||||||
|
|
||||||
if f.pkg.types[fun].IsType() {
|
if f.pkg.types[fun].IsType() {
|
||||||
return // a conversion, not a call
|
return // a conversion, not a call
|
||||||
|
Loading…
Reference in New Issue
Block a user