wire: in tests, don't copy want/wire_gen.go into the temporary GOPATH (google/go-cloud#646)

This does not change the results of the test, but should not be
happening.
This commit is contained in:
Ross Light
2018-11-07 14:11:44 -08:00
parent 64470a2452
commit c3ea2961cb

View File

@@ -488,13 +488,17 @@ func loadTestCase(root string, wireGoSrc []byte) (*testCase, error) {
if err != nil {
return err
}
if !info.Mode().IsRegular() || filepath.Ext(src) != ".go" {
return nil
}
rel, err := filepath.Rel(root, src)
if err != nil {
return err // unlikely
}
if info.Mode().IsDir() && rel == "want" {
// The "want" directory should not be included in goFiles.
return filepath.SkipDir
}
if !info.Mode().IsRegular() || filepath.Ext(src) != ".go" {
return nil
}
data, err := ioutil.ReadFile(src)
if err != nil {
return err