unmarshal [] into a slice makes the slice nil, not empty
Bug #1231527 reported by
Nate Finch
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
goyaml |
New
|
Undecided
|
Unassigned |
Bug Description
code:
package main
import "launchpad.
import "fmt"
func main() {
s := []string{}
data, _ := goyaml.Marshal(s)
fmt.Printf("%s\n", string(data))
var s2 []string
goyaml.
fmt.Printf(
}
output:
[]
[]string(nil)
expected output:
[]
[]string{}
To post a comment you must log in.