mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-05 04:55:18 +00:00
lint: cleanup pending lint errors (#7237)
This commit is contained in:
@@ -43,7 +43,7 @@ func (bz *HexBytes) UnmarshalJSON(data []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Bytes fulfils various interfaces in light-client, etc...
|
||||
// Bytes fulfills various interfaces in light-client, etc...
|
||||
func (bz HexBytes) Bytes() []byte {
|
||||
return bz
|
||||
}
|
||||
|
||||
@@ -13,7 +13,8 @@ func TestEventCache_Flush(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
err = evsw.AddListenerForEvent("nothingness", "", func(data EventData) {
|
||||
// Check we are not initialising an empty buffer full of zeroed eventInfos in the EventCache
|
||||
// Check we are not initializing an empty buffer full
|
||||
// of zeroed eventInfos in the EventCache
|
||||
require.FailNow(t, "We should never receive a message on this switch since none are fired")
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -61,7 +61,6 @@ func (c CustomValue) MarshalJSON() ([]byte, error) {
|
||||
}
|
||||
|
||||
func (c CustomValue) UnmarshalJSON(bz []byte) error {
|
||||
c.Value = "custom"
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ func iotest(writer protoio.WriteCloser, reader protoio.ReadCloser) error {
|
||||
return err
|
||||
}
|
||||
if n != len(bz)+visize {
|
||||
return fmt.Errorf("WriteMsg() wrote %v bytes, expected %v", n, len(bz)+visize) // nolint
|
||||
return fmt.Errorf("WriteMsg() wrote %v bytes, expected %v", n, len(bz)+visize)
|
||||
}
|
||||
lens[i] = n
|
||||
}
|
||||
|
||||
@@ -23,16 +23,16 @@ var (
|
||||
type Subscription struct {
|
||||
out chan Message
|
||||
|
||||
cancelled chan struct{}
|
||||
mtx tmsync.RWMutex
|
||||
err error
|
||||
canceled chan struct{}
|
||||
mtx tmsync.RWMutex
|
||||
err error
|
||||
}
|
||||
|
||||
// NewSubscription returns a new subscription with the given outCapacity.
|
||||
func NewSubscription(outCapacity int) *Subscription {
|
||||
return &Subscription{
|
||||
out: make(chan Message, outCapacity),
|
||||
cancelled: make(chan struct{}),
|
||||
out: make(chan Message, outCapacity),
|
||||
canceled: make(chan struct{}),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,13 +43,14 @@ func (s *Subscription) Out() <-chan Message {
|
||||
return s.out
|
||||
}
|
||||
|
||||
// nolint: misspell
|
||||
// Cancelled returns a channel that's closed when the subscription is
|
||||
// terminated and supposed to be used in a select statement.
|
||||
func (s *Subscription) Cancelled() <-chan struct{} {
|
||||
return s.cancelled
|
||||
return s.canceled
|
||||
}
|
||||
|
||||
// Err returns nil if the channel returned by Cancelled is not yet closed.
|
||||
// Err returns nil if the channel returned is not yet closed.
|
||||
// If the channel is closed, Err returns a non-nil error explaining why:
|
||||
// - ErrUnsubscribed if the subscriber choose to unsubscribe,
|
||||
// - ErrOutOfCapacity if the subscriber is not pulling messages fast enough
|
||||
@@ -66,7 +67,7 @@ func (s *Subscription) cancel(err error) {
|
||||
s.mtx.Lock()
|
||||
s.err = err
|
||||
s.mtx.Unlock()
|
||||
close(s.cancelled)
|
||||
close(s.canceled)
|
||||
}
|
||||
|
||||
// Message glues data and events together.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build deadlock
|
||||
// +build deadlock
|
||||
|
||||
package sync
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build !deadlock
|
||||
// +build !deadlock
|
||||
|
||||
package sync
|
||||
|
||||
Reference in New Issue
Block a user