struct fields are not indirected correctly for SetYAML
Bug #1225038 reported by
Roger Peppe
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
goyaml |
New
|
Undecided
|
Unassigned |
Bug Description
The following program illustrates the problem. The encoding/json package does the right thing here.
I would expect to see the "set yaml called correctly" panic.
package main
import (
"fmt"
"launchpad.
"encoding/json"
)
type Foo struct {
S Bar
}
type Bar int
func (b *Bar) SetYAML(tag string, value interface{}) bool {
panic("set yaml called correctly")
}
func (b *Bar) UnmarshalJSON(
panic("unmarshal json called correctly")
}
func main() {
var foo Foo
err := goyaml.
fmt.Printf("yaml err: %v\n", err)
err = json.Unmarshal(
fmt.Printf("json err: %v\n", err)
}
To post a comment you must log in.