generated from TrueCloudLab/basic
Aleksey Savaitan
db6cf1ea16
All checks were successful
DCO action / DCO (pull_request) Successful in 45s
Tests and linters / Tests (1.21) (pull_request) Successful in 1m38s
Tests and linters / Tests (1.22) (pull_request) Successful in 1m38s
Tests and linters / Tests with -race (pull_request) Successful in 1m42s
Tests and linters / Staticcheck (pull_request) Successful in 1m50s
Tests and linters / Lint (pull_request) Successful in 2m0s
Signed-off-by: Aleksey Savaitan <a.savaitan@yadro.com>
25 lines
559 B
Go
25 lines
559 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 google.golang.org/grpc/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)
|
|
}
|