From d760b790b37a5d26b3068ed9f5b4efcaa3cf5cae Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Tue, 17 Feb 2015 19:28:10 +0900 Subject: [PATCH] Fix typo in code --- src/matcher.go | 2 +- src/reader_test.go | 8 ++++---- src/util/eventbox.go | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/matcher.go b/src/matcher.go index 1ea9541..bbd9c89 100644 --- a/src/matcher.go +++ b/src/matcher.go @@ -183,7 +183,7 @@ func (m *Matcher) scan(request MatchRequest, limit int) (*Merger, bool) { break } - if !empty && m.reqBox.Peak(reqReset) { + if !empty && m.reqBox.Peek(reqReset) { return nil, wait() } diff --git a/src/reader_test.go b/src/reader_test.go index 5800b3f..144a3ff 100644 --- a/src/reader_test.go +++ b/src/reader_test.go @@ -14,7 +14,7 @@ func TestReadFromCommand(t *testing.T) { eventBox: eb} // Check EventBox - if eb.Peak(EvtReadNew) { + if eb.Peek(EvtReadNew) { t.Error("EvtReadNew should not be set yet") } @@ -25,7 +25,7 @@ func TestReadFromCommand(t *testing.T) { } // Check EventBox again - if !eb.Peak(EvtReadNew) { + if !eb.Peek(EvtReadNew) { t.Error("EvtReadNew should be set yet") } @@ -38,7 +38,7 @@ func TestReadFromCommand(t *testing.T) { }) // EventBox is cleared - if eb.Peak(EvtReadNew) { + if eb.Peek(EvtReadNew) { t.Error("EvtReadNew should not be set yet") } @@ -50,7 +50,7 @@ func TestReadFromCommand(t *testing.T) { } // Check EventBox again - if eb.Peak(EvtReadNew) { + if eb.Peek(EvtReadNew) { t.Error("Command failed. EvtReadNew should be set") } } diff --git a/src/util/eventbox.go b/src/util/eventbox.go index a5821ea..e16b736 100644 --- a/src/util/eventbox.go +++ b/src/util/eventbox.go @@ -53,8 +53,8 @@ func (events *Events) Clear() { } } -// Peak peaks at the event box if the given event is set -func (b *EventBox) Peak(event EventType) bool { +// Peek peeks at the event box if the given event is set +func (b *EventBox) Peek(event EventType) bool { b.cond.L.Lock() defer b.cond.L.Unlock() _, ok := b.events[event]