Skip to content

Commit 44f71c7

Browse files
authored
Merge pull request #575 from GilGil1/master
Fix of small typos from PR #574
2 parents 6f41a8c + 0d8179f commit 44f71c7

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ func (c *client) attemptConnection() (net.Conn, byte, bool, error) {
393393
tlsCfg = c.options.OnConnectAttempt(broker, c.options.TLSConfig)
394394
}
395395
// Start by opening the network connection (tcp, tls, ws) etc
396-
if c.options.CustomOpenConnectionFn != nil{
396+
if c.options.CustomOpenConnectionFn != nil {
397397
conn, err = c.options.CustomOpenConnectionFn(broker, c.options)
398398
} else {
399399
conn, err = openConnection(broker, tlsCfg, c.options.ConnectTimeout, c.options.HTTPHeaders, c.options.WebsocketOptions, c.options.Dialer)

client_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
)
2828

2929
func TestCustomConnectionFunction(t *testing.T) {
30-
// Set netpipe to emu
30+
// Set netpipe to emulate a connection of a different type
3131
netClient, netServer := net.Pipe()
3232
defer netClient.Close()
3333
defer netServer.Close()
@@ -59,6 +59,6 @@ func TestCustomConnectionFunction(t *testing.T) {
5959

6060
// Analyze first message sent by client and received by the server
6161
if len(firstMessage) <= 0 || !strings.Contains(firstMessage, "MQTT") {
62-
t.Error("no message recieved on connect")
62+
t.Error("no message received on connect")
6363
}
6464
}

options.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -437,12 +437,12 @@ func (o *ClientOptions) SetDialer(dialer *net.Dialer) *ClientOptions {
437437
return o
438438
}
439439

440-
// SetCustomOpenConectionFn replaces the inbuilt function that establishes a network connection with a custom function.
440+
// SetCustomOpenConnectionFn replaces the inbuilt function that establishes a network connection with a custom function.
441441
// The passed in function should return an open `net.Conn` or an error (see the existing openConnection function for an example)
442442
// It enables custom networking types in addition to the defaults (tcp, tls, websockets...)
443-
func (o *ClientOptions) SetCustomOpenConectionFn(customOpenConnectionfn OpenConnectionFunc) *ClientOptions {
444-
if customOpenConnectionfn != nil {
445-
o.CustomOpenConnectionFn = customOpenConnectionfn
443+
func (o *ClientOptions) SetCustomOpenConnectionFn(customOpenConnectionFn OpenConnectionFunc) *ClientOptions {
444+
if customOpenConnectionFn != nil {
445+
o.CustomOpenConnectionFn = customOpenConnectionFn
446446
}
447447
return o
448448
}

options_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func TestSetCustomConnectionOptions(t *testing.T) {
3232
return nil, fmt.Errorf("not implemented open connection func")
3333
}
3434
options := &ClientOptions{}
35-
options = options.SetCustomOpenConectionFn(customConnectionFunc)
35+
options = options.SetCustomOpenConnectionFn(customConnectionFunc)
3636
if options.CustomOpenConnectionFn == nil {
3737
t.Error("custom open connection function cannot be set")
3838
}

0 commit comments

Comments
 (0)