We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3385008 commit 368f98eCopy full SHA for 368f98e
cmds/vcard2json/vcard2json.go
@@ -122,7 +122,7 @@ func main() {
122
if err != nil {
123
log.Fatalf("Can't read file, %s", err)
124
}
125
- vcard := new(datatools.VCard)
+ vcard := datatools.NewVCard()
126
if err := vcard.Parse(src); err != nil {
127
log.Fatalf("Can't parse vcard, %s", err)
128
vcard.go
@@ -39,6 +39,12 @@ type VCard struct {
39
Ext map[string]string `xml:"ext,omitempty" json:"ext,omitempty"`
40
41
42
+func NewVCard() *VCard {
43
+ v := new(VCard)
44
+ v.Ext = make(map[string]string)
45
+ return v
46
+}
47
+
48
func (vcard *VCard) Parse(src []byte) error {
49
var (
50
err error
0 commit comments