Simplify code per gosimple linter.
This simplifies the code based on the recommendations of the gosimple lint tool.
This commit is contained in:
parent
5c3e647618
commit
b83f837ad2
4 changed files with 19 additions and 95 deletions
|
@ -106,13 +106,9 @@ 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
|
||||
}
|
||||
|
||||
// SetGenerateAsync returns an instance of a type that can be used to get the
|
||||
// result of the RPC at some future time by invoking the Receive function on the
|
||||
// returned instance.
|
||||
|
|
8
net.go
8
net.go
|
@ -41,13 +41,9 @@ 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
|
||||
}
|
||||
|
||||
// AddNodeAsync returns an instance of a type that can be used to get the result
|
||||
// of the RPC at some future time by invoking the Receive function on the
|
||||
// returned instance.
|
||||
|
@ -193,13 +189,9 @@ 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
|
||||
}
|
||||
|
||||
// PingAsync returns an instance of a type that can be used to get the result of
|
||||
// the RPC at some future time by invoking the Receive function on the returned
|
||||
// instance.
|
||||
|
|
20
notify.go
20
notify.go
|
@ -663,13 +663,9 @@ 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
|
||||
}
|
||||
|
||||
// NotifyBlocksAsync returns an instance of a type that can be used to get the
|
||||
// result of the RPC at some future time by invoking the Receive function on
|
||||
// the returned instance.
|
||||
|
@ -715,13 +711,9 @@ 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
|
||||
}
|
||||
|
||||
// notifySpentInternal is the same as notifySpentAsync except it accepts
|
||||
// the converted outpoints as a parameter so the client can more efficiently
|
||||
// recreate the previous notification state on reconnect.
|
||||
|
@ -799,13 +791,9 @@ 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
|
||||
}
|
||||
|
||||
// NotifyNewTransactionsAsync returns an instance of a type that can be used to
|
||||
// get the result of the RPC at some future time by invoking the Receive
|
||||
// function on the returned instance.
|
||||
|
@ -852,13 +840,9 @@ 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
|
||||
}
|
||||
|
||||
// notifyReceivedInternal is the same as notifyReceivedAsync except it accepts
|
||||
// the converted addresses as a parameter so the client can more efficiently
|
||||
// recreate the previous notification state on reconnect.
|
||||
|
@ -936,13 +920,9 @@ 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
|
||||
}
|
||||
|
||||
// RescanAsync returns an instance of a type that can be used to get the result
|
||||
// of the RPC at some future time by invoking the Receive function on the
|
||||
// returned instance.
|
||||
|
|
44
wallet.go
44
wallet.go
|
@ -423,13 +423,9 @@ 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
|
||||
}
|
||||
|
||||
// SetTxFeeAsync returns an instance of a type that can be used to get the
|
||||
// result of the RPC at some future time by invoking the Receive function on the
|
||||
// returned instance.
|
||||
|
@ -852,13 +848,9 @@ type FutureCreateNewAccountResult chan *response
|
|||
// result of creating new account.
|
||||
func (r FutureCreateNewAccountResult) Receive() error {
|
||||
_, err := receiveFuture(r)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// CreateNewAccountAsync returns an instance of a type that can be used to get the
|
||||
// result of the RPC at some future time by invoking the Receive function on the
|
||||
// returned instance.
|
||||
|
@ -1035,13 +1027,9 @@ 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
|
||||
}
|
||||
|
||||
// SetAccountAsync returns an instance of a type that can be used to get the
|
||||
// result of the RPC at some future time by invoking the Receive function on the
|
||||
// returned instance.
|
||||
|
@ -1205,13 +1193,9 @@ type FutureRenameAccountResult chan *response
|
|||
// result of creating new account.
|
||||
func (r FutureRenameAccountResult) Receive() error {
|
||||
_, err := receiveFuture(r)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RenameAccountAsync returns an instance of a type that can be used to get the
|
||||
// result of the RPC at some future time by invoking the Receive function on the
|
||||
// returned instance.
|
||||
|
@ -1273,13 +1257,9 @@ type FutureKeyPoolRefillResult chan *response
|
|||
// of refilling the key pool.
|
||||
func (r FutureKeyPoolRefillResult) Receive() error {
|
||||
_, err := receiveFuture(r)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// KeyPoolRefillAsync returns an instance of a type that can be used to get the
|
||||
// result of the RPC at some future time by invoking the Receive function on the
|
||||
// returned instance.
|
||||
|
@ -1852,13 +1832,9 @@ type FutureWalletLockResult chan *response
|
|||
// of locking the wallet.
|
||||
func (r FutureWalletLockResult) Receive() error {
|
||||
_, err := receiveFuture(r)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// WalletLockAsync returns an instance of a type that can be used to get the
|
||||
// result of the RPC at some future time by invoking the Receive function on the
|
||||
// returned instance.
|
||||
|
@ -1884,13 +1860,9 @@ 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
|
||||
}
|
||||
|
||||
// FutureWalletPassphraseChangeResult is a future promise to deliver the result
|
||||
// of a WalletPassphraseChangeAsync RPC invocation (or an applicable error).
|
||||
type FutureWalletPassphraseChangeResult chan *response
|
||||
|
@ -1899,13 +1871,9 @@ type FutureWalletPassphraseChangeResult chan *response
|
|||
// of changing the wallet passphrase.
|
||||
func (r FutureWalletPassphraseChangeResult) Receive() error {
|
||||
_, err := receiveFuture(r)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// WalletPassphraseChangeAsync returns an instance of a type that can be used to
|
||||
// get the result of the RPC at some future time by invoking the Receive
|
||||
// function on the returned instance.
|
||||
|
@ -2063,13 +2031,9 @@ 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
|
||||
}
|
||||
|
||||
// ImportAddressAsync returns an instance of a type that can be used to get the
|
||||
// result of the RPC at some future time by invoking the Receive function on the
|
||||
// returned instance.
|
||||
|
@ -2110,13 +2074,9 @@ type FutureImportPrivKeyResult chan *response
|
|||
// (WIF).
|
||||
func (r FutureImportPrivKeyResult) Receive() error {
|
||||
_, err := receiveFuture(r)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ImportPrivKeyAsync returns an instance of a type that can be used to get the
|
||||
// result of the RPC at some future time by invoking the Receive function on the
|
||||
// returned instance.
|
||||
|
@ -2189,13 +2149,9 @@ 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
|
||||
}
|
||||
|
||||
// ImportPubKeyAsync returns an instance of a type that can be used to get the
|
||||
// result of the RPC at some future time by invoking the Receive function on the
|
||||
// returned instance.
|
||||
|
|
Loading…
Add table
Reference in a new issue