frostfs-observability/testdata/testdata.go
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
[#13] support tls over grpc for otlp_grpc exporter type
Signed-off-by: Aleksey Savaitan <a.savaitan@yadro.com>
2024-09-09 13:01:07 +03:00

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)
}