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