mirror of
https://github.com/joshuarubin/go-sway
synced 2024-11-22 21:11:59 +01:00
fix a missed error check
This commit is contained in:
parent
06cea6451d
commit
07f0e51891
@ -89,7 +89,9 @@ func New(ctx context.Context, opts ...Option) (_ Client, err error) {
|
|||||||
return nil, fmt.Errorf("$SWAYSOCK is empty")
|
return nil, fmt.Errorf("$SWAYSOCK is empty")
|
||||||
}
|
}
|
||||||
|
|
||||||
c.conn, err = (&net.Dialer{}).DialContext(ctx, "unix", c.path)
|
if c.conn, err = (&net.Dialer{}).DialContext(ctx, "unix", c.path); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
if lifecycle.Exists(ctx) {
|
if lifecycle.Exists(ctx) {
|
||||||
lifecycle.DeferErr(ctx, c.conn.Close)
|
lifecycle.DeferErr(ctx, c.conn.Close)
|
||||||
@ -100,7 +102,7 @@ func New(ctx context.Context, opts ...Option) (_ Client, err error) {
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
return c, err
|
return c, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type payloadReader struct {
|
type payloadReader struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user