1
0
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:
Joshua Rubin 2019-04-15 10:11:13 -06:00
parent 06cea6451d
commit 07f0e51891
No known key found for this signature in database
GPG Key ID: 673103A1CC175722

@ -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 {