Skip to content
This repository was archived by the owner on Nov 9, 2019. It is now read-only.

Commit 5d76cc4

Browse files
committed
Removes unnecessary return value
1 parent d124a6b commit 5d76cc4

File tree

4 files changed

+6
-24
lines changed

4 files changed

+6
-24
lines changed

export.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,12 @@ func exportCommand(args ...string) int {
1212
return handleError(err)
1313
}
1414

15-
accounts, err := safe.List()
16-
if err != nil {
17-
return handleError(err)
18-
}
19-
15+
accounts := safe.List()
2016
if len(accounts) < 1 {
2117
fmt.Println("No accounts to export")
2218
return 1
2319
}
2420

25-
var accountSlice []interface{}
26-
for _, account := range accounts {
27-
accountSlice = append(accountSlice, account)
28-
}
29-
30-
utils.PrettyPrint(accountSlice)
21+
utils.PrettyPrint(accounts)
3122
return 0
3223
}

list.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,8 @@ func listCommand(args ...string) int {
1111
return handleError(err)
1212
}
1313

14-
accounts, err := safe.List()
15-
if err != nil {
16-
return handleError(err)
17-
}
18-
1914
var accountNames []string
20-
for _, account := range accounts {
15+
for _, account := range safe.List() {
2116
accountNames = append(accountNames, account.Name)
2217
}
2318

safe/list.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package safe
22

3-
func (s *Safe) List() ([]Account, error) {
3+
func (s *Safe) List() []Account {
44
var accounts []Account
55
for _, account := range s.Accounts {
66
accounts = append(accounts, account)
77
}
88

9-
return accounts, nil
9+
return accounts
1010
}

safe/list_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ func TestList(t *testing.T) {
1616
t.Error(err)
1717
}
1818

19-
accounts, err := safe.List()
20-
if err != nil {
21-
t.Error(err)
22-
}
23-
19+
accounts := safe.List()
2420
if len(accounts) < 1 {
2521
t.Error(err)
2622
}

0 commit comments

Comments
 (0)