You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zk/util/fixtures/fixtures.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)
}