From: Robert Griesemer Date: Tue, 16 Jun 2015 22:21:39 +0000 (-0700) Subject: go/types: don't export gcCompatibilityMode flag X-Git-Tag: go1.5beta1~231 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d3e8a3614c4aad86a48100a196a7ff4a6e2164ca;p=gostls13.git go/types: don't export gcCompatibilityMode flag This flag is not needed in the std repo because we don't have tests requiring it. Remove it before it's frozen into the API. Change-Id: I18b861eea146ad67e7a3c26ee8be681d8065ef12 Reviewed-on: https://go-review.googlesource.com/11150 Reviewed-by: Alan Donovan --- diff --git a/src/go/types/typestring.go b/src/go/types/typestring.go index 9a537e8177..6f527bbed0 100644 --- a/src/go/types/typestring.go +++ b/src/go/types/typestring.go @@ -11,7 +11,7 @@ import ( "fmt" ) -// If GcCompatibilityMode is set, printing of types is modified +// If gcCompatibilityMode is set, printing of types is modified // to match the representation of some types in the gc compiler: // // - byte and rune lose their alias name and simply stand for @@ -24,8 +24,12 @@ import ( // // Caution: This flag affects all uses of WriteType, globally. // It is only provided for testing in conjunction with -// gc-generated data. It may be removed at any time. -var GcCompatibilityMode bool +// gc-generated data. +// +// This flag is exported in the x/tools/go/types package. We don't +// need it at the moment in the std repo and so we don't export it +// anymore. We should eventually try to remove it altogether. +var gcCompatibilityMode bool // TypeString returns the string representation of typ. // Named types are printed package-qualified if they @@ -64,7 +68,7 @@ func writeType(buf *bytes.Buffer, this *Package, typ Type, visited []Type) { if t.kind == UnsafePointer { buf.WriteString("unsafe.") } - if GcCompatibilityMode { + if gcCompatibilityMode { // forget the alias names switch t.kind { case Byte: @@ -124,7 +128,7 @@ func writeType(buf *bytes.Buffer, this *Package, typ Type, visited []Type) { // } // buf.WriteString("interface{") - if GcCompatibilityMode { + if gcCompatibilityMode { // print flattened interface // (useful to compare against gc-generated interfaces) for i, m := range t.allMethods {