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:
@@ -488,13 +488,17 @@ func loadTestCase(root string, wireGoSrc []byte) (*testCase, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if !info.Mode().IsRegular() || filepath.Ext(src) != ".go" {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
rel, err := filepath.Rel(root, src)
|
rel, err := filepath.Rel(root, src)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err // unlikely
|
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)
|
data, err := ioutil.ReadFile(src)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user