...
1# If the PATH environment variable is set in the testscript.Params.Setup phase
2# or set directly within a script, exec should honour that PATH
3
4[!exec:go] skip
5
6env HOME=$WORK${/}home
7[windows] env USERPROFILE=$WORK\home
8[windows] env LOCALAPPDATA=$WORK\appdata
9
10cd go
11exec go$exe version
12stdout 'go version'
13exec go$exe build
14env PATH=$WORK${/}go${:}$PATH
15exec go$exe version
16stdout 'This is not go'
17
18-- go/go.mod --
19module example.com/go
20
21-- go/main.go --
22package main
23
24import "fmt"
25
26func main() {
27 fmt.Println("This is not go")
28}
View as plain text