From 502f3e2281e7b9bed9a9a5172b51143f2e54732b Mon Sep 17 00:00:00 2001 From: Dominic Della Valle Date: Mon, 10 Jul 2023 23:45:19 -0400 Subject: [PATCH] commands: lint - use consistent option apply style --- internal/commands/client.go | 5 +---- internal/commands/mount.go | 6 +----- internal/commands/shutdown.go | 5 +---- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/internal/commands/client.go b/internal/commands/client.go index 18f64c62..f0a8ca22 100644 --- a/internal/commands/client.go +++ b/internal/commands/client.go @@ -122,10 +122,7 @@ func (co clientOptions) make() (clientSettings, error) { settings := clientSettings{ exitInterval: exitIntervalDefault, } - if err := generic.ApplyOptions(&settings, co...); err != nil { - return clientSettings{}, err - } - return settings, nil + return settings, generic.ApplyOptions(&settings, co...) } func (c *Client) getListeners() ([]multiaddr.Multiaddr, error) { diff --git a/internal/commands/mount.go b/internal/commands/mount.go index 1513245e..36eafe36 100644 --- a/internal/commands/mount.go +++ b/internal/commands/mount.go @@ -188,11 +188,7 @@ func (mo *mountCmdOptions[HT, GT, HM, GM, HC, GC]) BindFlags(flagSet *flag.FlagS } func (mo mountCmdOptions[HT, GT, HM, GM, HC, GC]) make() (mountCmdSettings[HM, GM], error) { - var settings mountCmdSettings[HM, GM] - if err := generic.ApplyOptions(&settings, mo...); err != nil { - return settings, err - } - return settings, nil + return makeWithOptions(mo...) } func (mp *mountCmdSettings[HM, GM]) marshalMountpoints(args ...string) ([][]byte, error) { diff --git a/internal/commands/shutdown.go b/internal/commands/shutdown.go index d3a714a9..d557aa30 100644 --- a/internal/commands/shutdown.go +++ b/internal/commands/shutdown.go @@ -89,10 +89,7 @@ func (so shutdownOptions) make() (shutdownSettings, error) { settings := shutdownSettings{ disposition: dispositionDefault, } - if err := generic.ApplyOptions(&settings, so...); err != nil { - return shutdownSettings{}, err - } - return settings, nil + return settings, generic.ApplyOptions(&settings, so...) } func shutdownLevelsTable() string {