Simplify code per gosimple linter.

This simplifies the code based on the recommendations of the gosimple
lint tool.
This commit is contained in:
Dave Collins 2016-11-16 14:52:02 -06:00
parent 5c3e647618
commit b83f837ad2
4 changed files with 19 additions and 95 deletions

View file

@ -106,11 +106,7 @@ type FutureSetGenerateResult chan *response
// any occurred when setting the server to generate coins (mine) or not. // any occurred when setting the server to generate coins (mine) or not.
func (r FutureSetGenerateResult) Receive() error { func (r FutureSetGenerateResult) Receive() error {
_, err := receiveFuture(r) _, err := receiveFuture(r)
if err != nil { return err
return err
}
return nil
} }
// SetGenerateAsync returns an instance of a type that can be used to get the // SetGenerateAsync returns an instance of a type that can be used to get the

12
net.go
View file

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

View file

@ -663,11 +663,7 @@ type FutureNotifyBlocksResult chan *response
// if the registration was not successful. // if the registration was not successful.
func (r FutureNotifyBlocksResult) Receive() error { func (r FutureNotifyBlocksResult) Receive() error {
_, err := receiveFuture(r) _, err := receiveFuture(r)
if err != nil { return err
return err
}
return nil
} }
// NotifyBlocksAsync returns an instance of a type that can be used to get the // NotifyBlocksAsync returns an instance of a type that can be used to get the
@ -715,11 +711,7 @@ type FutureNotifySpentResult chan *response
// if the registration was not successful. // if the registration was not successful.
func (r FutureNotifySpentResult) Receive() error { func (r FutureNotifySpentResult) Receive() error {
_, err := receiveFuture(r) _, err := receiveFuture(r)
if err != nil { return err
return err
}
return nil
} }
// notifySpentInternal is the same as notifySpentAsync except it accepts // notifySpentInternal is the same as notifySpentAsync except it accepts
@ -799,11 +791,7 @@ type FutureNotifyNewTransactionsResult chan *response
// if the registration was not successful. // if the registration was not successful.
func (r FutureNotifyNewTransactionsResult) Receive() error { func (r FutureNotifyNewTransactionsResult) Receive() error {
_, err := receiveFuture(r) _, err := receiveFuture(r)
if err != nil { return err
return err
}
return nil
} }
// NotifyNewTransactionsAsync returns an instance of a type that can be used to // NotifyNewTransactionsAsync returns an instance of a type that can be used to
@ -852,11 +840,7 @@ type FutureNotifyReceivedResult chan *response
// if the registration was not successful. // if the registration was not successful.
func (r FutureNotifyReceivedResult) Receive() error { func (r FutureNotifyReceivedResult) Receive() error {
_, err := receiveFuture(r) _, err := receiveFuture(r)
if err != nil { return err
return err
}
return nil
} }
// notifyReceivedInternal is the same as notifyReceivedAsync except it accepts // notifyReceivedInternal is the same as notifyReceivedAsync except it accepts
@ -936,11 +920,7 @@ type FutureRescanResult chan *response
// if the rescan was not successful. // if the rescan was not successful.
func (r FutureRescanResult) Receive() error { func (r FutureRescanResult) Receive() error {
_, err := receiveFuture(r) _, err := receiveFuture(r)
if err != nil { return err
return err
}
return nil
} }
// RescanAsync returns an instance of a type that can be used to get the result // RescanAsync returns an instance of a type that can be used to get the result

View file

@ -423,11 +423,7 @@ type FutureSetTxFeeResult chan *response
// are processed quickly. Most transaction are 1KB. // are processed quickly. Most transaction are 1KB.
func (r FutureSetTxFeeResult) Receive() error { func (r FutureSetTxFeeResult) Receive() error {
_, err := receiveFuture(r) _, err := receiveFuture(r)
if err != nil { return err
return err
}
return nil
} }
// SetTxFeeAsync returns an instance of a type that can be used to get the // SetTxFeeAsync returns an instance of a type that can be used to get the
@ -852,11 +848,7 @@ type FutureCreateNewAccountResult chan *response
// result of creating new account. // result of creating new account.
func (r FutureCreateNewAccountResult) Receive() error { func (r FutureCreateNewAccountResult) Receive() error {
_, err := receiveFuture(r) _, err := receiveFuture(r)
if err != nil { return err
return err
}
return nil
} }
// CreateNewAccountAsync returns an instance of a type that can be used to get the // CreateNewAccountAsync returns an instance of a type that can be used to get the
@ -1035,11 +1027,7 @@ type FutureSetAccountResult chan *response
// of setting the account to be associated with the passed address. // of setting the account to be associated with the passed address.
func (r FutureSetAccountResult) Receive() error { func (r FutureSetAccountResult) Receive() error {
_, err := receiveFuture(r) _, err := receiveFuture(r)
if err != nil { return err
return err
}
return nil
} }
// SetAccountAsync returns an instance of a type that can be used to get the // SetAccountAsync returns an instance of a type that can be used to get the
@ -1205,11 +1193,7 @@ type FutureRenameAccountResult chan *response
// result of creating new account. // result of creating new account.
func (r FutureRenameAccountResult) Receive() error { func (r FutureRenameAccountResult) Receive() error {
_, err := receiveFuture(r) _, err := receiveFuture(r)
if err != nil { return err
return err
}
return nil
} }
// RenameAccountAsync returns an instance of a type that can be used to get the // RenameAccountAsync returns an instance of a type that can be used to get the
@ -1273,11 +1257,7 @@ type FutureKeyPoolRefillResult chan *response
// of refilling the key pool. // of refilling the key pool.
func (r FutureKeyPoolRefillResult) Receive() error { func (r FutureKeyPoolRefillResult) Receive() error {
_, err := receiveFuture(r) _, err := receiveFuture(r)
if err != nil { return err
return err
}
return nil
} }
// KeyPoolRefillAsync returns an instance of a type that can be used to get the // KeyPoolRefillAsync returns an instance of a type that can be used to get the
@ -1852,11 +1832,7 @@ type FutureWalletLockResult chan *response
// of locking the wallet. // of locking the wallet.
func (r FutureWalletLockResult) Receive() error { func (r FutureWalletLockResult) Receive() error {
_, err := receiveFuture(r) _, err := receiveFuture(r)
if err != nil { return err
return err
}
return nil
} }
// WalletLockAsync returns an instance of a type that can be used to get the // WalletLockAsync returns an instance of a type that can be used to get the
@ -1884,11 +1860,7 @@ func (c *Client) WalletLock() error {
func (c *Client) WalletPassphrase(passphrase string, timeoutSecs int64) error { func (c *Client) WalletPassphrase(passphrase string, timeoutSecs int64) error {
cmd := btcjson.NewWalletPassphraseCmd(passphrase, timeoutSecs) cmd := btcjson.NewWalletPassphraseCmd(passphrase, timeoutSecs)
_, err := c.sendCmdAndWait(cmd) _, err := c.sendCmdAndWait(cmd)
if err != nil { return err
return err
}
return nil
} }
// FutureWalletPassphraseChangeResult is a future promise to deliver the result // FutureWalletPassphraseChangeResult is a future promise to deliver the result
@ -1899,11 +1871,7 @@ type FutureWalletPassphraseChangeResult chan *response
// of changing the wallet passphrase. // of changing the wallet passphrase.
func (r FutureWalletPassphraseChangeResult) Receive() error { func (r FutureWalletPassphraseChangeResult) Receive() error {
_, err := receiveFuture(r) _, err := receiveFuture(r)
if err != nil { return err
return err
}
return nil
} }
// WalletPassphraseChangeAsync returns an instance of a type that can be used to // WalletPassphraseChangeAsync returns an instance of a type that can be used to
@ -2063,11 +2031,7 @@ type FutureImportAddressResult chan *response
// of importing the passed public address. // of importing the passed public address.
func (r FutureImportAddressResult) Receive() error { func (r FutureImportAddressResult) Receive() error {
_, err := receiveFuture(r) _, err := receiveFuture(r)
if err != nil { return err
return err
}
return nil
} }
// ImportAddressAsync returns an instance of a type that can be used to get the // ImportAddressAsync returns an instance of a type that can be used to get the
@ -2110,11 +2074,7 @@ type FutureImportPrivKeyResult chan *response
// (WIF). // (WIF).
func (r FutureImportPrivKeyResult) Receive() error { func (r FutureImportPrivKeyResult) Receive() error {
_, err := receiveFuture(r) _, err := receiveFuture(r)
if err != nil { return err
return err
}
return nil
} }
// ImportPrivKeyAsync returns an instance of a type that can be used to get the // ImportPrivKeyAsync returns an instance of a type that can be used to get the
@ -2189,11 +2149,7 @@ type FutureImportPubKeyResult chan *response
// of importing the passed public key. // of importing the passed public key.
func (r FutureImportPubKeyResult) Receive() error { func (r FutureImportPubKeyResult) Receive() error {
_, err := receiveFuture(r) _, err := receiveFuture(r)
if err != nil { return err
return err
}
return nil
} }
// ImportPubKeyAsync returns an instance of a type that can be used to get the // ImportPubKeyAsync returns an instance of a type that can be used to get the