Modify goclean.sh to run go vet recursively.
Fix remaining issues discovered by vet.
This commit is contained in:
parent
86420c4890
commit
f827743934
3 changed files with 8 additions and 3 deletions
|
@ -55,7 +55,7 @@ var opts = struct {
|
|||
RPCConnect: "localhost",
|
||||
RPCUsername: "",
|
||||
RPCCertificateFile: filepath.Join(walletDataDirectory, "rpc.cert"),
|
||||
FeeRate: &cfgutil.AmountFlag{txrules.DefaultRelayFeePerKb},
|
||||
FeeRate: cfgutil.NewAmountFlag(txrules.DefaultRelayFeePerKb),
|
||||
SourceAccount: "imported",
|
||||
DestinationAccount: "default",
|
||||
RequiredConfirmations: 1,
|
||||
|
@ -337,7 +337,7 @@ func parseOutPoint(input *btcjson.ListUnspentResult) (wire.OutPoint, error) {
|
|||
if err != nil {
|
||||
return wire.OutPoint{}, err
|
||||
}
|
||||
return wire.OutPoint{*txHash, input.Vout}, nil
|
||||
return wire.OutPoint{Hash: *txHash, Index: input.Vout}, nil
|
||||
}
|
||||
|
||||
func pickNoun(n int, singularForm, pluralForm string) string {
|
||||
|
|
|
@ -13,7 +13,7 @@ set -ex
|
|||
test -z "$(gofmt -l -w . | tee /dev/stderr)"
|
||||
test -z "$(goimports -l -w . | tee /dev/stderr)"
|
||||
test -z "$(golint ./... | grep -v 'ALL_CAPS\|OP_\|NewFieldVal\|RpcCommand\|RpcRawCommand\|RpcSend\|Dns\|api.pb.go\|StartConsensusRpc\|factory_test.go\|legacy' | tee /dev/stderr)"
|
||||
test -z "$(go tool vet . 2>&1 | grep -v 'Example\|newestSha\|rpcserver/server.go' | tee /dev/stderr)"
|
||||
test -z "$(go vet ./... 2>&1 | grep -v 'Example\|newestSha\|rpcserver/server.go' | tee /dev/stderr)"
|
||||
env GORACE="halt_on_error=1" go test -v -race ./...
|
||||
|
||||
# Run test coverage on each subdirectories and merge the coverage profile.
|
||||
|
|
|
@ -17,6 +17,11 @@ type AmountFlag struct {
|
|||
btcutil.Amount
|
||||
}
|
||||
|
||||
// NewAmountFlag creates an AmountFlag with a default btcutil.Amount.
|
||||
func NewAmountFlag(defaultValue btcutil.Amount) *AmountFlag {
|
||||
return &AmountFlag{defaultValue}
|
||||
}
|
||||
|
||||
// MarshalFlag satisifes the flags.Marshaler interface.
|
||||
func (a *AmountFlag) MarshalFlag() (string, error) {
|
||||
return a.Amount.String(), nil
|
||||
|
|
Loading…
Reference in a new issue