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
}
if !empty && m.reqBox.Peak(reqReset) {
if !empty && m.reqBox.Peek(reqReset) {
return nil, wait()
}

View File

@ -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")
}
}

View File

@ -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]