spf13--viper/internal/testutil/filepath.go
Mark Sagi-Kazar 14c9dc6a57 test: fix file find tests on windows
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
2021-09-22 20:41:33 +02:00

18 lines
245 B
Go

package testutil
import (
"path/filepath"
"testing"
)
// AbsFilePath calls filepath.Abs on path.
func AbsFilePath(t *testing.T, path string) string {
t.Helper()
s, err := filepath.Abs(path)
if err != nil {
t.Fatal(err)
}
return s
}