feat: small refactor. basic PRIVMSG sending

This commit is contained in:
2022-01-05 00:54:54 +02:00
parent 327f59a14c
commit 1168a2a4dd
6 changed files with 134 additions and 66 deletions
+3 -4
View File
@@ -34,8 +34,7 @@ type Client struct {
const CRLF = "\r\n"
func NewClient(host string, port string, tlsEnabled bool) *Client {
// TODO: distinguish between secure and insecure connections
func NewClient(host string, port string, tlsEnabled bool) Client {
addr := fmt.Sprintf("%s:%s", host, port)
if tlsEnabled {
@@ -46,7 +45,7 @@ func NewClient(host string, port string, tlsEnabled bool) *Client {
log.Fatal(err)
}
return &Client{
return Client{
TlsConn: conn,
TcpConn: nil,
}
@@ -62,7 +61,7 @@ func NewClient(host string, port string, tlsEnabled bool) *Client {
log.Fatal(err)
}
return &Client{
return Client{
TlsConn: nil,
TcpConn: conn,
}