zk/internal/util/fixtures/fixtures.go
Mickaël Menu 50855154e2
Architecture (#27)
* Move everything under the internal package.
* Better separation between core and adapter packages, for easier unit testing.
* Simplify data models.
* Support multiple opened notebooks during runtime (useful for the LSP server).
* Proper surface API which might be exposed later as a public Go package.
2021-04-14 20:14:01 +02:00

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), "testdata", name)
}