aboutsummaryrefslogtreecommitdiffstats
path: root/library/go/test/yatest/go.go
blob: cc03951257a6240f31ec057a00fb4e668f65bd4f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package yatest

import (
	"os"
)

func PrepareGOPATH() error {
	return preparePath("GOPATH")
}

func PrepareGOCACHE() error {
	return preparePath("GOCACHE")
}

func preparePath(name string) error {
	p, err := os.MkdirTemp(WorkPath(""), "name")
	if err != nil {
		return err
	}
	return os.Setenv(name, p)
}