Fix typo in code

This commit is contained in:
Junegunn Choi 2015-02-17 19:28:10 +09:00
parent 1b5599972a
commit d760b790b3
3 changed files with 7 additions and 7 deletions

View File

@ -183,7 +183,7 @@ func (m *Matcher) scan(request MatchRequest, limit int) (*Merger, bool) {
break break
} }
if !empty && m.reqBox.Peak(reqReset) { if !empty && m.reqBox.Peek(reqReset) {
return nil, wait() return nil, wait()
} }

View File

@ -14,7 +14,7 @@ func TestReadFromCommand(t *testing.T) {
eventBox: eb} eventBox: eb}
// Check EventBox // Check EventBox
if eb.Peak(EvtReadNew) { if eb.Peek(EvtReadNew) {
t.Error("EvtReadNew should not be set yet") t.Error("EvtReadNew should not be set yet")
} }
@ -25,7 +25,7 @@ func TestReadFromCommand(t *testing.T) {
} }
// Check EventBox again // Check EventBox again
if !eb.Peak(EvtReadNew) { if !eb.Peek(EvtReadNew) {
t.Error("EvtReadNew should be set yet") t.Error("EvtReadNew should be set yet")
} }
@ -38,7 +38,7 @@ func TestReadFromCommand(t *testing.T) {
}) })
// EventBox is cleared // EventBox is cleared
if eb.Peak(EvtReadNew) { if eb.Peek(EvtReadNew) {
t.Error("EvtReadNew should not be set yet") t.Error("EvtReadNew should not be set yet")
} }
@ -50,7 +50,7 @@ func TestReadFromCommand(t *testing.T) {
} }
// Check EventBox again // Check EventBox again
if eb.Peak(EvtReadNew) { if eb.Peek(EvtReadNew) {
t.Error("Command failed. EvtReadNew should be set") t.Error("Command failed. EvtReadNew should be set")
} }
} }

View File

@ -53,8 +53,8 @@ func (events *Events) Clear() {
} }
} }
// Peak peaks at the event box if the given event is set // Peek peeks at the event box if the given event is set
func (b *EventBox) Peak(event EventType) bool { func (b *EventBox) Peek(event EventType) bool {
b.cond.L.Lock() b.cond.L.Lock()
defer b.cond.L.Unlock() defer b.cond.L.Unlock()
_, ok := b.events[event] _, ok := b.events[event]