Bladeren bron

cmd/protoc-gen-go: assume type alias support in golden_test

The v2 API already assumes that type aliases are available elsewhere.
Thus, we can drop this dynamic check for type alias support.

Change-Id: Ia4deab8f22384a982642da4a9aa5166870822b7d
Reviewed-on: https://go-review.googlesource.com/133877
Reviewed-by: Damien Neil <dneil@google.com>
Joe Tsai 7 jaren geleden
bovenliggende
commit
c84688961e
1 gewijzigde bestanden met toevoegingen van 0 en 15 verwijderingen
  1. 0 15
      cmd/protoc-gen-go/golden_test.go

+ 0 - 15
cmd/protoc-gen-go/golden_test.go

@@ -7,7 +7,6 @@ package main
 import (
 	"bytes"
 	"flag"
-	"go/build"
 	"io/ioutil"
 	"os"
 	"os/exec"
@@ -39,13 +38,8 @@ func TestGolden(t *testing.T) {
 
 	// Find all the proto files we need to compile. We assume that each directory
 	// contains the files for a single package.
-	supportTypeAliases := hasReleaseTag("go1.9")
 	packages := map[string][]string{}
 	err = filepath.Walk("testdata", func(path string, info os.FileInfo, err error) error {
-		if filepath.Base(path) == "import_public" && !supportTypeAliases {
-			// Public imports require type alias support.
-			return filepath.SkipDir
-		}
 		if !strings.HasSuffix(path, ".proto") {
 			return nil
 		}
@@ -134,12 +128,3 @@ func protoc(t *testing.T, args []string) {
 		t.Fatalf("protoc: %v", err)
 	}
 }
-
-func hasReleaseTag(want string) bool {
-	for _, tag := range build.Default.ReleaseTags {
-		if tag == want {
-			return true
-		}
-	}
-	return false
-}