aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/build_link_x_import_path_escape.txt
blob: f1de1e4c7129af961d25c5c8190b186354cef612 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[gccgo] skip 'gccgo does not support -ldflags -X'

go build -o linkx$GOEXE -ldflags -X=my.pkg.Text=linkXworked my.pkg/main
exec ./linkx$GOEXE
stderr '^linkXworked$'

-- go.mod --
module my.pkg

go 1.16
-- main/main.go --
package main

import "my.pkg"

func main() {
	println(pkg.Text)
}
-- pkg.go --
package pkg

var Text = "unset"