generated from TrueCloudLab/basic
Aleksey Savaitan
cb173523f4
All checks were successful
DCO action / DCO (pull_request) Successful in 49s
Tests and linters / Tests (pull_request) Successful in 51s
Tests and linters / Staticcheck (pull_request) Successful in 1m5s
Tests and linters / Tests with -race (pull_request) Successful in 1m20s
Tests and linters / Lint (pull_request) Successful in 1m44s
Signed-off-by: Aleksey Savaitan <a.savaitan@yadro.com>
25 lines
558 B
Go
25 lines
558 B
Go
package testdata
|
|
|
|
import (
|
|
"path/filepath"
|
|
"runtime"
|
|
)
|
|
|
|
// basepath is the root directory of this package.
|
|
var basepath string
|
|
|
|
func init() {
|
|
_, currentFile, _, _ := runtime.Caller(0)
|
|
basepath = filepath.Dir(currentFile)
|
|
}
|
|
|
|
// Path returns the absolute path the given relative file or directory path,
|
|
// relative to the frostfs-observability/testdata directory in the user's GOPATH.
|
|
// If rel is already absolute, it is returned unmodified.
|
|
func Path(rel string) string {
|
|
if filepath.IsAbs(rel) {
|
|
return rel
|
|
}
|
|
|
|
return filepath.Join(basepath, rel)
|
|
}
|