-
-
Notifications
You must be signed in to change notification settings - Fork 195
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When unmarhsalling null
or an empty document, the valid result is not written to v.
To Reproduce
package main
import (
"fmt"
"github.com/goccy/go-yaml"
)
func main() {
var v any
v = 0xdeadbeef
fmt.Println(yaml.Unmarshal([]byte(""), &v), v)
fmt.Println(yaml.Unmarshal([]byte("null"), &v), v)
}
Results in:
<nil> 3735928559
<nil> 3735928559
No error but also the result is not written.
Expected behavior
It should be:
<nil> <nil>
<nil> <nil>
Or possibly error unmarshalling null into integer?
Screenshots
Version Variables
- Go version: 1.24.4
- go-yaml's Version: 1.17.1
Additional context
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working