mirror of
https://github.com/IllusionMan1212/gorc.git
synced 2026-10-24 02:12:33 +00:00
feat: small refactor. basic PRIVMSG sending
This commit is contained in:
+3
-4
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user