From 111e409bb73978951466f80f1d3a04d11d89142b Mon Sep 17 00:00:00 2001 From: gostar Date: Thu, 26 Nov 2015 16:28:54 +0800 Subject: [PATCH] Update gob2.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为0创建不成功 --- eBook/examples/chapter_12/gob2.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eBook/examples/chapter_12/gob2.go b/eBook/examples/chapter_12/gob2.go index 217e161..70690c9 100644 --- a/eBook/examples/chapter_12/gob2.go +++ b/eBook/examples/chapter_12/gob2.go @@ -28,7 +28,7 @@ func main() { vc := VCard{"Jan", "Kersschot", []*Address{pa,wa}, "none"} // fmt.Printf("%v: \n", vc) // {Jan Kersschot [0x126d2b80 0x126d2be0] none}: // using an encoder: - file, _ := os.OpenFile("vcard.gob", os.O_CREATE|os.O_WRONLY, 0) + file, _ := os.OpenFile("vcard.gob", os.O_CREATE|os.O_WRONLY, 0666) defer file.Close() enc := gob.NewEncoder(file) err := enc.Encode(vc)