summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-02-17 19:28:10 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-02-17 19:28:10 +0900
commitd760b790b37a5d26b3068ed9f5b4efcaa3cf5cae (patch)
tree7f8d398182f207b8505ae8cbf1c0c1405899d163 /src
parent1b5599972abb1ca4d1498ec1dfe9bc041f8d238a (diff)
Fix typo in code
Diffstat (limited to 'src')
-rw-r--r--src/matcher.go2
-rw-r--r--src/reader_test.go8
-rw-r--r--src/util/eventbox.go4
3 files changed, 7 insertions, 7 deletions
diff --git a/src/matcher.go b/src/matcher.go
index 1ea9541b..bbd9c890 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 5800b3f2..144a3ff1 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 a5821eab..e16b736b 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]