unmarshalling map into *string has odd behaviour
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
goyaml |
Fix Released
|
Undecided
|
Gustavo Niemeyer |
Bug Description
The following program has this output:
"foo: ''\n" -> map[string]
"foo: ''\n" -> map[string]
"foo: null\n" -> map[string]
"foo: null\n" -> map[string]
Line 1 is as expected.
Line 2 is unexpected - why is the foo attribute disappearing?
Line 3 is unexpected - should an unquoted null really turn into the empty string?
Line 4 is as expected.
package main
import (
"fmt"
"launchpad.
)
func main() {
parse("foo: ''\n", make(map[
parse("foo: ''\n", make(map[
parse("foo: null\n", make(map[
parse("foo: null\n", make(map[
}
func parse(s string, x interface{}) {
fmt.Printf("%q ", s)
err := goyaml.
if err != nil {
fmt.Printf("-> error %v\n", err)
return
}
fmt.Printf("-> %#v\n", x)
}
Changed in goyaml: | |
status: | Fix Committed → Fix Released |
Fixed in r39 of lp:goyaml it seems.