maps should be made before being unmarshalled into

Bug #872364 reported by Roger Peppe
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
goyaml
New
Undecided
Unassigned

Bug Description

This code crashes assigning to a nil map. It should probably not.

 package main

 import (
  "fmt"
  "launchpad.net/goyaml"
 )

 func main() {
  var x map[string]string
  if err := goyaml.Unmarshal([]byte("foo: y\n"), &x); err != nil {
   fmt.Printf("unmarshal error: %v", err)
  } else {
   fmt.Printf("%#v\n", x)
  }
 }

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.