aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/run_set_executable_name.txt
blob: 54ddee9ae1f82a0a06120aa479fb32dd6422e6ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
env GO111MODULE=on
[short] skip

# Check for correct naming of temporary executable

#Test for single file specified
cd x/y/z
go run foo.go
stderr 'foo'

#Test for current directory
go run .
stderr 'z'

#Test for set path
go run m/x/y/z/
stderr 'z'

-- m/x/y/z/foo.go --
package main
import(
	"os"
	"path/filepath"
)
func main() {
	println(filepath.Base(os.Args[0]))
}

-- x/y/z/foo.go --
package main
import(
	"os"
	"path/filepath"
)
func main() {
	println(filepath.Base(os.Args[0]))
}

-- x/y/z/foo.go --
package main
import(
	"os"
	"path/filepath"
)
func main() {
	println(filepath.Base(os.Args[0]))
}

-- go.mod --
module m