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>
diff --git a/cmd/protoc-gen-go/golden_test.go b/cmd/protoc-gen-go/golden_test.go
index d0ed8ea..80e2d8c 100644
--- a/cmd/protoc-gen-go/golden_test.go
+++ b/cmd/protoc-gen-go/golden_test.go
@@ -7,7 +7,6 @@
import (
"bytes"
"flag"
- "go/build"
"io/ioutil"
"os"
"os/exec"
@@ -39,13 +38,8 @@
// 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 @@
t.Fatalf("protoc: %v", err)
}
}
-
-func hasReleaseTag(want string) bool {
- for _, tag := range build.Default.ReleaseTags {
- if tag == want {
- return true
- }
- }
- return false
-}