unmarshal "" into a *string leaves it as nil instead of an empty string
Bug #1231535 reported by
Nate Finch
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
goyaml |
New
|
Undecided
|
Unassigned |
Bug Description
package main
import "launchpad.
import "fmt"
func main() {
s := ""
mp := &s
data, _ := goyaml.Marshal(mp)
fmt.Printf("%s\n", string(data))
var s2 *string
goyaml.
if s2 != nil {
fmt.Printf("%v, %q\n", s2, *s2)
} else {
fmt.Printf(
}
}
actual output:
""
<nil>
expected output:
""
0xc20003b1c0, ""
summary: |
- unmarshal "" into a *string leaves it as nil instead of am empty string + unmarshal "" into a *string leaves it as nil instead of an empty string |
To post a comment you must log in.