can't unmarshal "" to *string field
Bug #1132537 reported by
William Reade
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
goyaml |
Fix Released
|
Undecided
|
Gustavo Niemeyer | ||
juju-core |
Fix Released
|
Medium
|
Данило Шеган |
Bug Description
In the following program, I would expect "yay" to be printed rather than "whoops" (or nothing).
-------
package main
import "launchpad.
func main() {
var v struct{ Hello *string }
if err := goyaml.
panic(err)
}
if v.Hello == nil {
} else if *v.Hello == "" {
}
}
Related branches
lp:~danilo/juju-core/bug-1132537
- Juju Engineering: Pending requested
-
Diff: 29 lines (+1/-11)1 file modifiedconstraints/constraints_test.go (+1/-11)
Changed in goyaml: | |
assignee: | nobody → Данило Шеган (danilo) |
status: | New → In Progress |
Changed in juju-core: | |
milestone: | none → 2.0 |
Changed in goyaml: | |
status: | Fix Committed → Fix Released |
Changed in juju-core: | |
status: | In Progress → Fix Committed |
Changed in juju-core: | |
importance: | Undecided → Medium |
Changed in juju-core: | |
milestone: | 2.0 → 1.10.0 |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I've verified that lp:goyaml r39 (fix for #1133337) fixes this as well. I'll be removing the test as it itself suggests and emailing the juju-dev list to remind everyone that they need to up the version of goyaml.