From 2b3d5556c222cd5682f24976c1b0dd02849fd9f4 Mon Sep 17 00:00:00 2001 From: ZhenLian Date: Thu, 4 Jun 2020 23:59:35 -0700 Subject: [PATCH] advancedtls: check error before deferring close --- security/advancedtls/advancedtls_integration_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/advancedtls/advancedtls_integration_test.go b/security/advancedtls/advancedtls_integration_test.go index 075e1e9f6ca2..5f8c25f681b3 100644 --- a/security/advancedtls/advancedtls_integration_test.go +++ b/security/advancedtls/advancedtls_integration_test.go @@ -405,10 +405,10 @@ func TestEnd2End(t *testing.T) { s := grpc.NewServer(grpc.Creds(serverTLSCreds)) defer s.Stop() lis, err := net.Listen("tcp", port) - defer lis.Close() if err != nil { t.Fatalf("failed to listen: %v", err) } + defer lis.Close() pb.RegisterGreeterServer(s, &serverImpl{}) go s.Serve(lis) clientOptions := &ClientOptions{