From 0672839e69c7c5423207f77f7de0a4bad812faf3 Mon Sep 17 00:00:00 2001 From: cuiweixie Date: Wed, 28 Sep 2022 10:44:32 +0800 Subject: [PATCH] crypto: use fmt.Appendf Change-Id: I022a221e2d73cd8c70e8e04b7046c388748646a5 Reviewed-on: https://go-review.googlesource.com/c/go/+/435696 Run-TryBot: Ian Lance Taylor Reviewed-by: Robert Griesemer Reviewed-by: Ian Lance Taylor Auto-Submit: Robert Griesemer Run-TryBot: Robert Griesemer Auto-Submit: Ian Lance Taylor TryBot-Result: Gopher Robot --- common.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.go b/common.go index 7d686fd..f860ac9 100644 --- a/common.go +++ b/common.go @@ -1338,7 +1338,7 @@ func (c *Config) writeKeyLog(label string, clientRandom, secret []byte) error { return nil } - logLine := []byte(fmt.Sprintf("%s %x %x\n", label, clientRandom, secret)) + logLine := fmt.Appendf(nil, "%s %x %x\n", label, clientRandom, secret) writerMutex.Lock() _, err := c.KeyLogWriter.Write(logLine)