Skip to content

Commit 3bc7a4c

Browse files
authored
Merge pull request #12 from pafuent/add_support_for_go_modules
Adding support for use with Go modules
2 parents a1b44e0 + ffa8e24 commit 3bc7a4c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

fixtures.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,14 @@ func Init() error {
335335
}
336336
}
337337

338+
// Try the modules local cache
339+
if dir, err := os.Getwd(); err == nil {
340+
if pkg, err := build.Default.Import("gopkg.in/src-d/go-git-fixtures.v3", dir, build.FindOnly); err == nil {
341+
RootFolder = pkg.Dir
342+
return nil
343+
}
344+
}
345+
338346
return errors.New("fixtures folder not found")
339347
}
340348

0 commit comments

Comments
 (0)