From 9f29259a10f382567a9a809ff745a906bbf67261 Mon Sep 17 00:00:00 2001 From: gostar Date: Thu, 12 Nov 2015 15:26:25 +0800 Subject: [PATCH] Update 12.11.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 纠错:为0时,写入文件失败。 --- eBook/12.11.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eBook/12.11.md b/eBook/12.11.md index bebc3d4..67e8dfe 100644 --- a/eBook/12.11.md +++ b/eBook/12.11.md @@ -117,7 +117,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) @@ -137,4 +137,4 @@ func main() { - [目录](directory.md) - 上一节:[XML 数据格式](12.10.md) -- 下一节:[Go 中的密码学](12.12.md) \ No newline at end of file +- 下一节:[Go 中的密码学](12.12.md)