]> Cypherpunks repositories - gostls13.git/commitdiff
go/types: don't export gcCompatibilityMode flag
authorRobert Griesemer <gri@golang.org>
Tue, 16 Jun 2015 22:21:39 +0000 (15:21 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 16 Jun 2015 22:35:08 +0000 (22:35 +0000)
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 <adonovan@google.com>
src/go/types/typestring.go

index 9a537e8177372a73bee0b86c917bcadea16ecc86..6f527bbed00e9b1cd125e92f38a30bbe7f31470b 100644 (file)
@@ -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 {