gotype: fix default importer for Go 1.8.

Importer "source" does not exist in Go 1.8, so this means that
default usage of gotype is broken in that compiler version.

Change-Id: I517520b0cac7c62a3e213d0647a3d621e8ced58c
Reviewed-on: https://go-review.googlesource.com/40091
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
diff --git a/cmd/gotype/gotype.go b/cmd/gotype/gotype.go
index 7d68d81..ed88e63 100644
--- a/cmd/gotype/gotype.go
+++ b/cmd/gotype/gotype.go
@@ -108,7 +108,7 @@
 	xtestFiles = flag.Bool("x", false, "consider only external test files in a directory")
 	allErrors  = flag.Bool("e", false, "report all errors, not just the first 10")
 	verbose    = flag.Bool("v", false, "verbose mode")
-	compiler   = flag.String("c", "source", "compiler used for installed packages (gc, gccgo, or source)")
+	compiler   = flag.String("c", defaultCompiler, "compiler used for installed packages (gc, gccgo, or source)")
 
 	// additional output control
 	printAST      = flag.Bool("ast", false, "print AST (forces -seq)")
diff --git a/cmd/gotype/sizesFor18.go b/cmd/gotype/sizesFor18.go
index 579da86..94e8176 100644
--- a/cmd/gotype/sizesFor18.go
+++ b/cmd/gotype/sizesFor18.go
@@ -11,6 +11,8 @@
 
 import "go/types"
 
+const defaultCompiler = "gc"
+
 var gcArchSizes = map[string]*types.StdSizes{
 	"386":      {4, 4},
 	"arm":      {4, 4},
diff --git a/cmd/gotype/sizesFor19.go b/cmd/gotype/sizesFor19.go
index 090ec65..9e0b481 100644
--- a/cmd/gotype/sizesFor19.go
+++ b/cmd/gotype/sizesFor19.go
@@ -8,6 +8,8 @@
 
 import "go/types"
 
+const defaultCompiler = "source"
+
 func SizesFor(compiler, arch string) types.Sizes {
 	return types.SizesFor(compiler, arch)
 }