From aa6c640e7724a3de5d79d0e8f3fd3f4bd784e3e9 Mon Sep 17 00:00:00 2001 From: Irying Date: Sat, 17 Feb 2018 15:13:25 +0800 Subject: [PATCH] the right word is 'fetch' --- src/chan1/oneway/phandler.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chan1/oneway/phandler.go b/src/chan1/oneway/phandler.go index 031f382..13cfedc 100644 --- a/src/chan1/oneway/phandler.go +++ b/src/chan1/oneway/phandler.go @@ -60,7 +60,7 @@ func main() { handler := getPersonHandler() origs := make(chan Person, 100) dests := handler.Batch(origs) - fecthPerson(origs) + fetchPerson(origs) sign := savePerson(dests) <-sign } @@ -85,14 +85,14 @@ func savePerson(dest <-chan Person) <-chan byte { return sign } -func fecthPerson(origs chan<- Person) { +func fetchPerson(origs chan<- Person) { origsCap := cap(origs) buffered := origsCap > 0 goTicketTotal := origsCap / 2 goTicket := initGoTicket(goTicketTotal) go func() { for { - p, ok := fecthPerson1() + p, ok := fetchPerson1() if !ok { for { if !buffered || len(goTicket) == goTicketTotal { @@ -129,7 +129,7 @@ func initGoTicket(total int) chan byte { return goTicket } -func fecthPerson1() (Person, bool) { +func fetchPerson1() (Person, bool) { if personCount < personTotal { p := persons[personCount] personCount++