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

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

View as plain text