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

     1  # Go+BoringCrypto conflicts with GOFIPS140.
     2  [GOEXPERIMENT:boringcrypto] skip
     3  
     4  # list with GOFIPS140=off
     5  env GOFIPS140=off
     6  go list -f '{{.DefaultGODEBUG}}'
     7  ! stdout fips140
     8  
     9  # list with GOFIPS140=latest
    10  env GOFIPS140=latest
    11  go list -f '{{.DefaultGODEBUG}}'
    12  stdout fips140=on
    13  
    14  # build with GOFIPS140=off is cached
    15  env GOFIPS140=off
    16  go build -x -o x.exe
    17  ! stderr .-fipso
    18  go build -x -o x.exe
    19  ! stderr link
    20  
    21  # build with GOFIPS140=latest is cached too
    22  env GOFIPS140=latest
    23  go build -x -o x.exe
    24  stderr link.*-fipso
    25  go build -x -o x.exe
    26  ! stderr link.*-fipso
    27  
    28  # build test with GOFIPS140=off is cached
    29  env GOFIPS140=off
    30  go test -x -c
    31  ! stderr .-fipso
    32  go test -x -c
    33  ! stderr link
    34  
    35  # build test with GOFIPS140=latest is cached
    36  env GOFIPS140=latest
    37  go test -x -c
    38  stderr link.*-fipso
    39  go test -x -c
    40  ! stderr link
    41  
    42  -- go.mod --
    43  module m
    44  -- x.go --
    45  package main
    46  import _ "crypto/sha256"
    47  func main() {
    48  }
    49  -- x_test.go --
    50  package main
    51  import "testing"
    52  func Test(t *testing.T) {}
    53  

View as plain text