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