file.MyDir() must return directory of caller

It was returning the directory in which the library code lives.
Whoops.
This commit is contained in:
Chris Masone
2015-12-21 13:50:02 -08:00
parent 9efa948e9c
commit 4e38862186

View File

@@ -25,7 +25,7 @@ func DumbCopy(srcPath, dstPath string) {
// MyDir returns the directory in which the file containing the calling source code resides.
func MyDir() string {
_, path, _, ok := runtime.Caller(0)
_, path, _, ok := runtime.Caller(1)
d.Chk.True(ok, "Should have been able to get Caller.")
return filepath.Dir(path)
}