Skip to content

Commit 87a7201

Browse files
committed
feat(client): improve
1 parent 3682f29 commit 87a7201

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

client/client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func NewFromConn(conn net.Conn) *Client {
3131
func New(endpoint string, opts Options) (*Client, error) {
3232
conn, err := net.Dial("tcp", endpoint)
3333
if err != nil {
34-
opts.Log.Fatal(err.Error())
34+
opts.Log.Fatal("failed to create discache client: %s", err.Error())
3535
}
3636
return &Client{
3737
Options: opts,
@@ -56,12 +56,12 @@ func (c *Client) Get(ctx context.Context, key []byte) ([]byte, error) {
5656
}
5757

5858
if resp.Status == transport.StatusExpired {
59-
c.Log.Warn(fmt.Sprintf("key [%s] expired", key))
59+
c.Log.Warn("key [%s] expired", key)
6060
return nil, nil
6161
}
6262

6363
if resp.Status == transport.StatusKeyNotFound {
64-
c.Log.Warn(fmt.Sprintf("key [%s] not present", key))
64+
c.Log.Warn("key [%s] not present", key)
6565
return nil, nil
6666
}
6767

0 commit comments

Comments
 (0)