fix keylog creation in the example client

This commit is contained in:
Marten Seemann 2020-02-12 15:38:50 +07:00
parent dd035c2f12
commit d6e4b100e8

View file

@ -36,14 +36,14 @@ func main() {
}
logger.SetLogTimeFormat("")
var keyLog *os.File
var keyLog io.Writer
if len(*keyLogFile) > 0 {
var err error
keyLog, err = os.Create(*keyLogFile)
f, err := os.Create(*keyLogFile)
if err != nil {
log.Fatal(err)
}
defer keyLog.Close()
defer f.Close()
keyLog = f
}
pool, err := x509.SystemCertPool()