mirror of
https://github.com/mickael-menu/zk
synced 2024-11-17 09:25:44 +00:00
16 lines
313 B
Go
16 lines
313 B
Go
|
package fixtures
|
||
|
|
||
|
import (
|
||
|
"path/filepath"
|
||
|
"runtime"
|
||
|
)
|
||
|
|
||
|
// Path returns the absolute path to the given fixture.
|
||
|
func Path(name string) string {
|
||
|
_, callerPath, _, ok := runtime.Caller(1)
|
||
|
if !ok {
|
||
|
panic("failed to get the caller's path")
|
||
|
}
|
||
|
return filepath.Join(filepath.Dir(callerPath), "fixtures", name)
|
||
|
}
|