aboutsummaryrefslogtreecommitdiff
path: root/mt4/client.go
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2025-06-04 12:09:26 +0300
committerGitHub <noreply@github.com>2025-06-04 12:09:26 +0300
commitb57c1a6878190abd6ed63e285e13b03a4fbac7a3 (patch)
tree32d143bd87bfb182c2035c6be09c6ee3b035f903 /mt4/client.go
parent7240595478fedec02e9e47c704976cf56a66d3e8 (diff)
downloadgo-metatrader4-b57c1a6878190abd6ed63e285e13b03a4fbac7a3.tar.xz
go-metatrader4-b57c1a6878190abd6ed63e285e13b03a4fbac7a3.zip
Added GitHub Actions (#4)
Diffstat (limited to 'mt4/client.go')
-rw-r--r--mt4/client.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/mt4/client.go b/mt4/client.go
index 8a5f388..74fceee 100644
--- a/mt4/client.go
+++ b/mt4/client.go
@@ -3,7 +3,6 @@ package mt4
import (
"context"
"fmt"
- "net"
"time"
"go.popov.link/metatrader4/internal/conn"
@@ -18,7 +17,6 @@ type Client struct {
readTimeout time.Duration
writeTimeout time.Duration
autoClose bool
- dialer net.Dialer
c *conn.Conn
}
@@ -86,7 +84,7 @@ func (c *Client) Execute(ctx context.Context, command string, params map[string]
encoded, err := proto.EncodeParams(params)
if err != nil {
if c.autoClose {
- c.Close()
+ _ = c.Close()
}
return "", err
}
@@ -94,14 +92,14 @@ func (c *Client) Execute(ctx context.Context, command string, params map[string]
if err := c.c.Send(ctx, req, c.writeTimeout); err != nil {
if c.autoClose {
- c.Close()
+ _ = c.Close()
}
return "", fmt.Errorf("send: %w", err)
}
respBytes, err := c.c.Receive(ctx, c.readTimeout)
if c.autoClose {
- c.Close()
+ _ = c.Close()
}
if err != nil {
return "", fmt.Errorf("receive: %w", err)