Просмотр исходного кода

Merge pull request #185 from sugeladi/patch-5

Update gob2.go
Unknwon 10 лет назад
Родитель
Сommit
ea15a1f136
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      eBook/examples/chapter_12/gob2.go

+ 1 - 1
eBook/examples/chapter_12/gob2.go

@@ -28,7 +28,7 @@ func main() {
 	vc := VCard{"Jan", "Kersschot", []*Address{pa,wa}, "none"}
 	vc := VCard{"Jan", "Kersschot", []*Address{pa,wa}, "none"}
 	// fmt.Printf("%v: \n", vc) // {Jan Kersschot [0x126d2b80 0x126d2be0] none}: 
 	// fmt.Printf("%v: \n", vc) // {Jan Kersschot [0x126d2b80 0x126d2be0] none}: 
 	// using an encoder:
 	// 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()
 	defer file.Close()
 	enc := gob.NewEncoder(file)
 	enc := gob.NewEncoder(file)
 	err := enc.Encode(vc)
 	err := enc.Encode(vc)