Skip to content

Commit 502f3e2

Browse files
committed
commands: lint - use consistent option apply style
1 parent 65e5445 commit 502f3e2

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

internal/commands/client.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,7 @@ func (co clientOptions) make() (clientSettings, error) {
122122
settings := clientSettings{
123123
exitInterval: exitIntervalDefault,
124124
}
125-
if err := generic.ApplyOptions(&settings, co...); err != nil {
126-
return clientSettings{}, err
127-
}
128-
return settings, nil
125+
return settings, generic.ApplyOptions(&settings, co...)
129126
}
130127

131128
func (c *Client) getListeners() ([]multiaddr.Multiaddr, error) {

internal/commands/mount.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,7 @@ func (mo *mountCmdOptions[HT, GT, HM, GM, HC, GC]) BindFlags(flagSet *flag.FlagS
188188
}
189189

190190
func (mo mountCmdOptions[HT, GT, HM, GM, HC, GC]) make() (mountCmdSettings[HM, GM], error) {
191-
var settings mountCmdSettings[HM, GM]
192-
if err := generic.ApplyOptions(&settings, mo...); err != nil {
193-
return settings, err
194-
}
195-
return settings, nil
191+
return makeWithOptions(mo...)
196192
}
197193

198194
func (mp *mountCmdSettings[HM, GM]) marshalMountpoints(args ...string) ([][]byte, error) {

internal/commands/shutdown.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,7 @@ func (so shutdownOptions) make() (shutdownSettings, error) {
8989
settings := shutdownSettings{
9090
disposition: dispositionDefault,
9191
}
92-
if err := generic.ApplyOptions(&settings, so...); err != nil {
93-
return shutdownSettings{}, err
94-
}
95-
return settings, nil
92+
return settings, generic.ApplyOptions(&settings, so...)
9693
}
9794

9895
func shutdownLevelsTable() string {

0 commit comments

Comments
 (0)