Skip to content

Commit

Permalink
Simplify code per gosimple linter.
Browse files Browse the repository at this point in the history
This simplifies the code based on the recommendations of the gosimple
lint tool.
  • Loading branch information
davecgh committed Nov 16, 2016
1 parent 5c3e647 commit b83f837
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 95 deletions.
6 changes: 1 addition & 5 deletions mining.go
Expand Up @@ -106,11 +106,7 @@ type FutureSetGenerateResult chan *response
// any occurred when setting the server to generate coins (mine) or not.
func (r FutureSetGenerateResult) Receive() error {
_, err := receiveFuture(r)
if err != nil {
return err
}

return nil
return err
}

// SetGenerateAsync returns an instance of a type that can be used to get the
Expand Down
12 changes: 2 additions & 10 deletions net.go
Expand Up @@ -41,11 +41,7 @@ type FutureAddNodeResult chan *response
// any occurred when performing the specified command.
func (r FutureAddNodeResult) Receive() error {
_, err := receiveFuture(r)
if err != nil {
return err
}

return nil
return err
}

// AddNodeAsync returns an instance of a type that can be used to get the result
Expand Down Expand Up @@ -193,11 +189,7 @@ type FuturePingResult chan *response
// of queueing a ping to be sent to each connected peer.
func (r FuturePingResult) Receive() error {
_, err := receiveFuture(r)
if err != nil {
return err
}

return nil
return err
}

// PingAsync returns an instance of a type that can be used to get the result of
Expand Down
30 changes: 5 additions & 25 deletions notify.go
Expand Up @@ -663,11 +663,7 @@ type FutureNotifyBlocksResult chan *response
// if the registration was not successful.
func (r FutureNotifyBlocksResult) Receive() error {
_, err := receiveFuture(r)
if err != nil {
return err
}

return nil
return err
}

// NotifyBlocksAsync returns an instance of a type that can be used to get the
Expand Down Expand Up @@ -715,11 +711,7 @@ type FutureNotifySpentResult chan *response
// if the registration was not successful.
func (r FutureNotifySpentResult) Receive() error {
_, err := receiveFuture(r)
if err != nil {
return err
}

return nil
return err
}

// notifySpentInternal is the same as notifySpentAsync except it accepts
Expand Down Expand Up @@ -799,11 +791,7 @@ type FutureNotifyNewTransactionsResult chan *response
// if the registration was not successful.
func (r FutureNotifyNewTransactionsResult) Receive() error {
_, err := receiveFuture(r)
if err != nil {
return err
}

return nil
return err
}

// NotifyNewTransactionsAsync returns an instance of a type that can be used to
Expand Down Expand Up @@ -852,11 +840,7 @@ type FutureNotifyReceivedResult chan *response
// if the registration was not successful.
func (r FutureNotifyReceivedResult) Receive() error {
_, err := receiveFuture(r)
if err != nil {
return err
}

return nil
return err
}

// notifyReceivedInternal is the same as notifyReceivedAsync except it accepts
Expand Down Expand Up @@ -936,11 +920,7 @@ type FutureRescanResult chan *response
// if the rescan was not successful.
func (r FutureRescanResult) Receive() error {
_, err := receiveFuture(r)
if err != nil {
return err
}

return nil
return err
}

// RescanAsync returns an instance of a type that can be used to get the result
Expand Down
66 changes: 11 additions & 55 deletions wallet.go
Expand Up @@ -423,11 +423,7 @@ type FutureSetTxFeeResult chan *response
// are processed quickly. Most transaction are 1KB.
func (r FutureSetTxFeeResult) Receive() error {
_, err := receiveFuture(r)
if err != nil {
return err
}

return nil
return err
}

// SetTxFeeAsync returns an instance of a type that can be used to get the
Expand Down Expand Up @@ -852,11 +848,7 @@ type FutureCreateNewAccountResult chan *response
// result of creating new account.
func (r FutureCreateNewAccountResult) Receive() error {
_, err := receiveFuture(r)
if err != nil {
return err
}

return nil
return err
}

// CreateNewAccountAsync returns an instance of a type that can be used to get the
Expand Down Expand Up @@ -1035,11 +1027,7 @@ type FutureSetAccountResult chan *response
// of setting the account to be associated with the passed address.
func (r FutureSetAccountResult) Receive() error {
_, err := receiveFuture(r)
if err != nil {
return err
}

return nil
return err
}

// SetAccountAsync returns an instance of a type that can be used to get the
Expand Down Expand Up @@ -1205,11 +1193,7 @@ type FutureRenameAccountResult chan *response
// result of creating new account.
func (r FutureRenameAccountResult) Receive() error {
_, err := receiveFuture(r)
if err != nil {
return err
}

return nil
return err
}

// RenameAccountAsync returns an instance of a type that can be used to get the
Expand Down Expand Up @@ -1273,11 +1257,7 @@ type FutureKeyPoolRefillResult chan *response
// of refilling the key pool.
func (r FutureKeyPoolRefillResult) Receive() error {
_, err := receiveFuture(r)
if err != nil {
return err
}

return nil
return err
}

// KeyPoolRefillAsync returns an instance of a type that can be used to get the
Expand Down Expand Up @@ -1852,11 +1832,7 @@ type FutureWalletLockResult chan *response
// of locking the wallet.
func (r FutureWalletLockResult) Receive() error {
_, err := receiveFuture(r)
if err != nil {
return err
}

return nil
return err
}

// WalletLockAsync returns an instance of a type that can be used to get the
Expand Down Expand Up @@ -1884,11 +1860,7 @@ func (c *Client) WalletLock() error {
func (c *Client) WalletPassphrase(passphrase string, timeoutSecs int64) error {
cmd := btcjson.NewWalletPassphraseCmd(passphrase, timeoutSecs)
_, err := c.sendCmdAndWait(cmd)
if err != nil {
return err
}

return nil
return err
}

// FutureWalletPassphraseChangeResult is a future promise to deliver the result
Expand All @@ -1899,11 +1871,7 @@ type FutureWalletPassphraseChangeResult chan *response
// of changing the wallet passphrase.
func (r FutureWalletPassphraseChangeResult) Receive() error {
_, err := receiveFuture(r)
if err != nil {
return err
}

return nil
return err
}

// WalletPassphraseChangeAsync returns an instance of a type that can be used to
Expand Down Expand Up @@ -2063,11 +2031,7 @@ type FutureImportAddressResult chan *response
// of importing the passed public address.
func (r FutureImportAddressResult) Receive() error {
_, err := receiveFuture(r)
if err != nil {
return err
}

return nil
return err
}

// ImportAddressAsync returns an instance of a type that can be used to get the
Expand Down Expand Up @@ -2110,11 +2074,7 @@ type FutureImportPrivKeyResult chan *response
// (WIF).
func (r FutureImportPrivKeyResult) Receive() error {
_, err := receiveFuture(r)
if err != nil {
return err
}

return nil
return err
}

// ImportPrivKeyAsync returns an instance of a type that can be used to get the
Expand Down Expand Up @@ -2189,11 +2149,7 @@ type FutureImportPubKeyResult chan *response
// of importing the passed public key.
func (r FutureImportPubKeyResult) Receive() error {
_, err := receiveFuture(r)
if err != nil {
return err
}

return nil
return err
}

// ImportPubKeyAsync returns an instance of a type that can be used to get the
Expand Down

0 comments on commit b83f837

Please sign in to comment.