mirror of
https://blitiri.com.ar/repos/chasquid
synced 2026-01-05 17:37:03 +00:00
Minor style and simplification cleanups
This patch does various minor style and simplification cleanups, fixing things detected by tools such as go vet, gofmt -s, and golint. There are no functional changes, this change is purely cosmetic, but will enable us to run those tools more regularly now that their output is clean.
This commit is contained in:
@@ -26,7 +26,7 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
queueFullError = fmt.Errorf("Queue size too big, try again later")
|
||||
errQueueFull = fmt.Errorf("Queue size too big, try again later")
|
||||
)
|
||||
|
||||
// Channel used to get random IDs for items in the queue.
|
||||
@@ -90,7 +90,7 @@ func (q *Queue) Len() int {
|
||||
// Put an envelope in the queue.
|
||||
func (q *Queue) Put(from string, to []string, data []byte) (string, error) {
|
||||
if q.Len() >= maxQueueSize {
|
||||
return "", queueFullError
|
||||
return "", errQueueFull
|
||||
}
|
||||
|
||||
item := &Item{
|
||||
|
||||
@@ -117,7 +117,7 @@ func TestFullQueue(t *testing.T) {
|
||||
|
||||
// This one should fail due to the queue being too big.
|
||||
id, err := q.Put("from", []string{"to"}, []byte("data"))
|
||||
if err != queueFullError {
|
||||
if err != errQueueFull {
|
||||
t.Errorf("Not failed as expected: %v - %v", id, err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user