diff --git a/cmd/gotype/gotype.go b/cmd/gotype/gotype.go index 7d68d815a2..ed88e63546 100644 --- a/cmd/gotype/gotype.go +++ b/cmd/gotype/gotype.go @@ -108,7 +108,7 @@ var ( 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 579da8650d..94e817679f 100644 --- a/cmd/gotype/sizesFor18.go +++ b/cmd/gotype/sizesFor18.go @@ -11,6 +11,8 @@ package main 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 090ec65f0c..9e0b481c8f 100644 --- a/cmd/gotype/sizesFor19.go +++ b/cmd/gotype/sizesFor19.go @@ -8,6 +8,8 @@ package main import "go/types" +const defaultCompiler = "source" + func SizesFor(compiler, arch string) types.Sizes { return types.SizesFor(compiler, arch) }