Code refactoring for streams HandleFunc

This commit is contained in:
Alex X
2024-06-14 12:48:29 +03:00
parent 1ac9d54dab
commit ecfe802065
15 changed files with 53 additions and 93 deletions
+6 -2
View File
@@ -43,8 +43,12 @@ type Client struct {
recv int
}
func NewClient(url string) *Client {
return &Client{url: url}
func Dial(rawURL string) (*Client, error) {
client := &Client{url: rawURL}
if err := client.Dial(); err != nil {
return nil, err
}
return client, nil
}
const (