|
@@ -69,7 +69,7 @@ func main() {
|
|
|
js, _ := json.Marshal(vc)
|
|
js, _ := json.Marshal(vc)
|
|
|
fmt.Printf("JSON format: %s", js)
|
|
fmt.Printf("JSON format: %s", js)
|
|
|
// using an encoder:
|
|
// using an encoder:
|
|
|
- file, _ := os.OpenFile("vcard.json", os.O_CREATE|os.O_WRONLY, 0)
|
|
|
|
|
|
|
+ file, _ := os.OpenFile("vcard.json", os.O_CREATE|os.O_WRONLY, 0666)
|
|
|
defer file.Close()
|
|
defer file.Close()
|
|
|
enc := json.NewEncoder(file)
|
|
enc := json.NewEncoder(file)
|
|
|
err := enc.Encode(vc)
|
|
err := enc.Encode(vc)
|