Skip to content

Commit

Permalink
commands: lint - use consistent option apply style
Browse files Browse the repository at this point in the history
  • Loading branch information
djdv committed Jul 11, 2023
1 parent 65e5445 commit 502f3e2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
5 changes: 1 addition & 4 deletions internal/commands/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 1 addition & 5 deletions internal/commands/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 1 addition & 4 deletions internal/commands/shutdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 502f3e2

Please sign in to comment.