cmd/guru: fix and reenable failing test case

And avoid assumptions about the contents of the standard hash/fnv
package.

Change-Id: I10cc95ac6e3b482da5b027d68ff218d08f425e89
Reviewed-on: https://go-review.googlesource.com/40870
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/cmd/guru/guru_test.go b/cmd/guru/guru_test.go
index 9652bd9..3432255 100644
--- a/cmd/guru/guru_test.go
+++ b/cmd/guru/guru_test.go
@@ -225,7 +225,7 @@
 		"testdata/src/freevars/main.go",
 		"testdata/src/implements/main.go",
 		"testdata/src/implements-methods/main.go",
-		// "testdata/src/imports/main.go", // disabled until golang.org/issue/19464 is fixed
+		"testdata/src/imports/main.go",
 		"testdata/src/peers/main.go",
 		"testdata/src/pointsto/main.go",
 		"testdata/src/referrers/main.go",
diff --git a/cmd/guru/testdata/src/imports/main.go b/cmd/guru/testdata/src/imports/main.go
index 3bab36a..9fe2b71 100644
--- a/cmd/guru/testdata/src/imports/main.go
+++ b/cmd/guru/testdata/src/imports/main.go
@@ -1,8 +1,8 @@
 package main
 
 import (
-	"hash/fnv" // @describe ref-pkg-import2 "fnv"
-	"lib"      // @describe ref-pkg-import "lib"
+	"lib"        // @describe ref-pkg-import "lib"
+	"lib/sublib" // @describe ref-pkg-import2 "sublib"
 )
 
 // Tests that import another package.  (To make the tests run quickly,
@@ -25,5 +25,5 @@
 
 	var _ lib.Type // @describe ref-pkg "lib"
 
-	fnv.New32()
+	_ = sublib.C
 }
diff --git a/cmd/guru/testdata/src/imports/main.golden b/cmd/guru/testdata/src/imports/main.golden
index 89cfb2b..1e12217 100644
--- a/cmd/guru/testdata/src/imports/main.golden
+++ b/cmd/guru/testdata/src/imports/main.golden
@@ -1,10 +1,3 @@
--------- @describe ref-pkg-import2 --------
-import of package "hash/fnv"
-	func  New32  func() hash.Hash32
-	func  New32a func() hash.Hash32
-	func  New64  func() hash.Hash64
-	func  New64a func() hash.Hash64
-
 -------- @describe ref-pkg-import --------
 import of package "lib"
 	const Const  untyped int = 3
@@ -18,6 +11,10 @@
 		method (Type) Method(x *int) *int
 	var   Var    int
 
+-------- @describe ref-pkg-import2 --------
+import of package "lib/sublib"
+	const C untyped int = 0
+
 -------- @describe ref-const --------
 reference to const lib.Const untyped int of value 3
 defined here
diff --git a/cmd/guru/testdata/src/lib/sublib/sublib.go b/cmd/guru/testdata/src/lib/sublib/sublib.go
new file mode 100644
index 0000000..33c6498
--- /dev/null
+++ b/cmd/guru/testdata/src/lib/sublib/sublib.go
@@ -0,0 +1,3 @@
+package sublib
+
+const C = 0