func (td *TempDir) Path(file string) string {
	if strings.HasPrefix(file, td.root) {
		return filepath.FromSlash(file)
	}
	return filepath.Join(td.root, filepath.FromSlash(file))
}
Path returns the path to a file in the temp directory.
The input file is expected to use '/' as directory separator regardless of the host OS.
package testutil
import (
	"io/ioutil"
	"os"
	"path/filepath"
	"strings"
	"testing"
	"sigs.k8s.io/yaml"
	"sigs.k8s.io/krew/internal/gitutil"
)
type TempDir struct {
	t    *testing.T
	root string
}
func NewTempDir(t *testing.T) *TempDir {
	t.Helper()
	root := t.TempDir()
	return &TempDir{t: t, root: root}
}
func (td *TempDir) Root() string {
	return td.root
}