mirror of
https://salsa.debian.org/mdosch/go-sendxmpp
synced 2024-11-18 21:25:31 +00:00
Simplify connection code.
This commit is contained in:
parent
28521a16aa
commit
4664c02cbc
@ -49,11 +49,11 @@ func connect(options xmpp.Options, directTLS bool) (*xmpp.Client, error) {
|
||||
options.StartTLS = true
|
||||
options.Host = net.JoinHostPort(server, "5222")
|
||||
}
|
||||
// Connect to server
|
||||
client, err := options.NewClient()
|
||||
return client, err
|
||||
}
|
||||
// Connect to server
|
||||
client, err := options.NewClient()
|
||||
return client, err
|
||||
if err == nil {
|
||||
return client, nil
|
||||
}
|
||||
return client, fmt.Errorf("failed to connect to server: %w", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user