From 6cd130b00b75f4a2948369f742fa2c6d2ec8233b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20L=C3=B6ffel?= Date: Tue, 9 Oct 2018 11:14:43 +0200 Subject: [PATCH] renamed to subscribeHandler --- recws.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recws.go b/recws.go index 7724aa6..a7d5522 100644 --- a/recws.go +++ b/recws.go @@ -35,8 +35,8 @@ type RecConn struct { HandshakeTimeout time.Duration // NonVerbose suppress connecting/reconnecting messages. NonVerbose bool - // ConnectHandler fires after the connection successfully establish. - ConnectHandler func(rc *RecConn) error + // SubscribeHandler fires after the connection successfully establish. + SubscribeHandler func(rc *RecConn) error mu sync.Mutex url string @@ -217,11 +217,11 @@ func (rc *RecConn) connect() { log.Printf("Dial: connection was successfully established with %s\n", rc.url) } - if rc.ConnectHandler == nil { + if rc.SubscribeHandler == nil { return } - if err := rc.ConnectHandler(rc); err != nil { + if err := rc.SubscribeHandler(rc); err != nil { log.Fatalf("Dial: connect handler failed with %s", err.Error()) }