github.com/ShaleApps/viper@v1.15.1-concurrent/internal/testutil/filepath.go (about)

     1  package testutil
     2  
     3  import (
     4  	"path/filepath"
     5  	"testing"
     6  )
     7  
     8  // AbsFilePath calls filepath.Abs on path.
     9  func AbsFilePath(t *testing.T, path string) string {
    10  	t.Helper()
    11  
    12  	s, err := filepath.Abs(path)
    13  	if err != nil {
    14  		t.Fatal(err)
    15  	}
    16  
    17  	return s
    18  }