lint madness

This commit is contained in:
Zach Ramsay
2017-11-09 13:59:35 -05:00
committed by Ethan Buchman
parent 2563b4fc92
commit c4caad7720
2 changed files with 3 additions and 21 deletions

View File

@ -89,11 +89,8 @@ metalinter_test: ensure_tools
@gometalinter --vendor --deadline=600s --disable-all \
--enable=deadcode \
--enable=gas \
--enable=gosimple \
--enable=misspell \
--enable=safesql \
--enable=structcheck \
--enable=varcheck \
./...
#--enable=maligned \
@ -103,14 +100,17 @@ metalinter_test: ensure_tools
#--enable=gocyclo \
#--enable=goimports \
#--enable=golint \ <== comments on anything exported
#--enable=gosimple \
#--enable=gotype \
#--enable=ineffassign \
#--enable=interfacer \
#--enable=megacheck \
#--enable=staticcheck \
#--enable=structcheck \
#--enable=unconvert \
#--enable=unparam \
#--enable=unused \
#--enable=varcheck \
#--enable=vet \
#--enable=vetshadow \

View File

@ -1,18 +0,0 @@
package consensus
import (
"github.com/tendermint/tendermint/types"
)
// XXX: WARNING: this function can halt the consensus as firing events is synchronous.
// Make sure to read off the channels, and in the case of subscribeToEventRespond, to write back on it
// NOTE: if chanCap=0, this blocks on the event being consumed
func subscribeToEvent(evsw types.EventSwitch, receiver, eventID string, chanCap int) chan interface{} {
// listen for event
ch := make(chan interface{}, chanCap)
types.AddListenerForEvent(evsw, receiver, eventID, func(data types.TMEventData) {
ch <- data
})
return ch
}