make govet linter pass (#3292)

* make govet linter pass

Refs #3262

* close PipeReader and check for err
This commit is contained in:
Anton Kaliaev
2019-02-11 16:31:34 +04:00
committed by GitHub
parent 966b5bdf6e
commit 7fd51e6ade
27 changed files with 61 additions and 62 deletions

View File

@ -60,7 +60,9 @@ func Validators(heightPtr *int64) (*ctypes.ResultValidators, error) {
if err != nil {
return nil, err
}
return &ctypes.ResultValidators{height, validators.Validators}, nil
return &ctypes.ResultValidators{
BlockHeight: height,
Validators: validators.Validators}, nil
}
// DumpConsensusState dumps consensus state.
@ -223,7 +225,9 @@ func DumpConsensusState() (*ctypes.ResultDumpConsensusState, error) {
if err != nil {
return nil, err
}
return &ctypes.ResultDumpConsensusState{roundState, peerStates}, nil
return &ctypes.ResultDumpConsensusState{
RoundState: roundState,
Peers: peerStates}, nil
}
// ConsensusState returns a concise summary of the consensus state.
@ -276,7 +280,7 @@ func DumpConsensusState() (*ctypes.ResultDumpConsensusState, error) {
func ConsensusState() (*ctypes.ResultConsensusState, error) {
// Get self round state.
bz, err := consensusState.GetRoundStateSimpleJSON()
return &ctypes.ResultConsensusState{bz}, err
return &ctypes.ResultConsensusState{RoundState: bz}, err
}
// Get the consensus parameters at the given block height.
@ -327,5 +331,7 @@ func ConsensusParams(heightPtr *int64) (*ctypes.ResultConsensusParams, error) {
if err != nil {
return nil, err
}
return &ctypes.ResultConsensusParams{BlockHeight: height, ConsensusParams: consensusparams}, nil
return &ctypes.ResultConsensusParams{
BlockHeight: height,
ConsensusParams: consensusparams}, nil
}