]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/tls: small bogo shim test tidying
authorDaniel McCarney <daniel@binaryparadox.net>
Sat, 15 Feb 2025 15:07:19 +0000 (10:07 -0500)
committerDaniel McCarney <daniel@binaryparadox.net>
Fri, 7 Mar 2025 20:37:36 +0000 (12:37 -0800)
1. onResumeShimWritesFirst is unused, replace the binding with an
   underscore.
2. in the bogoShim() function when looping through resumeCount+1 the
   tlsConn read for loop only breaks for non-nil err, so there's no need
   to check that again after the loop body.

Updates #72006

Change-Id: Ieff45d26df33d71003a2509ea5b2b06c5fa0e1d6
Reviewed-on: https://go-review.googlesource.com/c/go/+/650715
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/crypto/tls/bogo_shim_test.go

index fdacbee25d803228a172599dc22419732e059d8a..569e627373695a0866c6b00ed967034f2d38218c 100644 (file)
@@ -82,10 +82,10 @@ var (
 
        expectSessionMiss = flag.Bool("expect-session-miss", false, "")
 
-       _                       = flag.Bool("enable-early-data", false, "")
-       _                       = flag.Bool("on-resume-expect-accept-early-data", false, "")
-       _                       = flag.Bool("expect-ticket-supports-early-data", false, "")
-       onResumeShimWritesFirst = flag.Bool("on-resume-shim-writes-first", false, "")
+       _ = flag.Bool("enable-early-data", false, "")
+       _ = flag.Bool("on-resume-expect-accept-early-data", false, "")
+       _ = flag.Bool("expect-ticket-supports-early-data", false, "")
+       _ = flag.Bool("on-resume-shim-writes-first", false, "")
 
        advertiseALPN        = flag.String("advertise-alpn", "", "")
        expectALPN           = flag.String("expect-alpn", "", "")
@@ -324,7 +324,7 @@ func bogoShim() {
                                break
                        }
                }
-               if err != nil && err != io.EOF {
+               if err != io.EOF {
                        retryErr, ok := err.(*ECHRejectionError)
                        if !ok {
                                log.Fatalf("unexpected error type returned: %v", err)