cmd/guru: implements: if selected expr is a value, use its type

...as the basis of the query, instead of reporting an error.

+ test

Change-Id: Ie5defa98cd8dfc8e200e296c2aa02c88893cf9ac
Reviewed-on: https://go-review.googlesource.com/22117
Reviewed-by: Michael Matloob <matloob@golang.org>
diff --git a/cmd/guru/implements.go b/cmd/guru/implements.go
index e852441..b7c2962 100644
--- a/cmd/guru/implements.go
+++ b/cmd/guru/implements.go
@@ -88,11 +88,17 @@
 				T = recv.Type()
 			}
 		}
+
+		// If not a method, use the expression's type.
+		if T == nil {
+			T = qpos.info.TypeOf(path[0].(ast.Expr))
+		}
+
 	case actionType:
 		T = qpos.info.TypeOf(path[0].(ast.Expr))
 	}
 	if T == nil {
-		return fmt.Errorf("no type or method here")
+		return fmt.Errorf("not a type, method, or value")
 	}
 
 	// Find all named types, even local types (which can have