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  [short] skip
    15  
    16  # build with GOFIPS140=off is cached
    17  env GOFIPS140=off
    18  go build -x -o x.exe
    19  ! stderr .-fipso
    20  go build -x -o x.exe
    21  ! stderr link
    22  
    23  # build with GOFIPS140=latest is cached too
    24  env GOFIPS140=latest
    25  go build -x -o x.exe
    26  stderr link.*-fipso
    27  go build -x -o x.exe
    28  ! stderr link.*-fipso
    29  
    30  # build test with GOFIPS140=off is cached
    31  env GOFIPS140=off
    32  go test -x -c
    33  ! stderr .-fipso
    34  go test -x -c
    35  ! stderr link
    36  
    37  # build test with GOFIPS140=latest is cached
    38  env GOFIPS140=latest
    39  go test -x -c
    40  stderr link.*-fipso
    41  go test -x -c
    42  ! stderr link
    43  
    44  -- go.mod --
    45  module m
    46  -- x.go --
    47  package main
    48  import _ "crypto/sha256"
    49  func main() {
    50  }
    51  -- x_test.go --
    52  package main
    53  import "testing"
    54  func Test(t *testing.T) {}
    55  

View as plain text