|
|
@@ -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
|
|
|
-}
|