From a4866e39649a32484c355f5a192cdfbeec7d82a3 Mon Sep 17 00:00:00 2001 From: Xargin Date: Wed, 28 Sep 2016 23:37:36 +0800 Subject: [PATCH] fix code typo --- ch9/ch9-07.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/ch9/ch9-07.md b/ch9/ch9-07.md index 56a086a..63f5bbe 100644 --- a/ch9/ch9-07.md +++ b/ch9/ch9-07.md @@ -163,9 +163,6 @@ type Memo struct { // Get is concurrency-safe. func (memo *Memo) Get(key string) (value interface{}, err error) { - res, ok := memo.cache[key] - if !ok { - res.value, res.err = memo.f(key) memo.cache[key] = res memo.mu.Lock() res, ok := memo.cache[key]