diff --git a/lib/web/apiserver_test.go b/lib/web/apiserver_test.go index b62b14027004d..b885724f52fbf 100644 --- a/lib/web/apiserver_test.go +++ b/lib/web/apiserver_test.go @@ -1045,13 +1045,13 @@ func (s *WebSuite) TestTerminalPing(c *C) { ws, err := s.makeTerminal(s.authPack(c, "foo")) c.Assert(err, IsNil) defer ws.Close() - closed := new(bool) + closed := false done := make(chan struct{}) ws.SetPingHandler(func(message string) error { - if *closed == false { + if closed == false { close(done) - *closed = true + closed = true } err := ws.WriteControl(websocket.PongMessage, []byte(message), time.Now().Add(time.Second))