...

Text file src/cmd/go/testdata/script/build_tag_goexperiment.txt

Documentation: cmd/go/testdata/script

     1[short] skip
     2# Reset all experiments so fieldtrack is definitely off.
     3env GOEXPERIMENT=none
     4go run m
     5stderr 'fieldtrack off'
     6# Turn fieldtrack on.
     7env GOEXPERIMENT=none,fieldtrack
     8go run m
     9stderr 'fieldtrack on'
    10
    11-- ft_off.go --
    12// +build !goexperiment.fieldtrack
    13
    14package main
    15
    16func main() {
    17	println("fieldtrack off")
    18}
    19
    20-- ft_on.go --
    21// +build goexperiment.fieldtrack
    22
    23package main
    24
    25func main() {
    26	println("fieldtrack on")
    27}
    28
    29-- go.mod --
    30module m
    31go 1.14

View as plain text