use init func not main func

Signed-off-by: Margo Crawford <margaretc@vmware.com>
This commit is contained in:
Margo Crawford 2022-03-15 08:50:51 -07:00 committed by Monis Khan
parent 643851291a
commit 1ee0aed054
No known key found for this signature in database
GPG Key ID: 52C90ADA01B269B8
2 changed files with 16 additions and 3 deletions

View File

@ -5,4 +5,13 @@ package main
import (
_ "crypto/tls/fipsonly" // restricts all TLS configuration to FIPS-approved settings.
"log"
"time"
)
func init() {
go func() {
time.Sleep(5 * time.Second)
log.Println("using boringcrypto in fipsonly mode")
}()
}

View File

@ -5,9 +5,13 @@ package ptls
import (
_ "crypto/tls/fipsonly" // restricts all TLS configuration to FIPS-approved settings.
"fmt"
"log"
"time"
)
func main() {
fmt.Println("using fips only mode.")
func init() {
go func() {
time.Sleep(5 * time.Second)
log.Println("using boringcrypto in fips only mode.")
}()
}