...
Text file
src/cmd/go/testdata/script/list_template_context_function.txt
1# This is a script test conversion of TestListTemplateContextFunction
2# originally added in CL 20010, which fixed #14547.
3# Test the ability to use the build context in the go list template.
4
5go list -f '{{context.GOARCH}} {{context.GOOS}} {{context.GOROOT}} {{context.GOPATH}}'
6cmpenv stdout want.txt
7
8go list -f '{{context.CgoEnabled}} {{context.UseAllFiles}} {{context.Compiler}} {{context.BuildTags}} {{context.ReleaseTags}} {{context.InstallSuffix}}'
9
10-- go.mod --
11module foo
12-- foo.go --
13package foo
14-- want.txt --
15$GOARCH $GOOS $GOROOT $GOPATH
View as plain text