From 3639b7a733690b490f951e440a55b45c2a5f24f6 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 16 Aug 2018 07:32:24 +0800 Subject: [PATCH] Update main.go Use int instead of = 0 --- 04_scope/02_block-scope/02_closure/03/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/04_scope/02_block-scope/02_closure/03/main.go b/04_scope/02_block-scope/02_closure/03/main.go index 54e0757b..02276e4f 100644 --- a/04_scope/02_block-scope/02_closure/03/main.go +++ b/04_scope/02_block-scope/02_closure/03/main.go @@ -3,7 +3,7 @@ package main import "fmt" func main() { - x := 0 + var x int increment := func() int { x++ return x