We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Unmarshaling panics:
panic: reflect.MakeSlice of non-slice type goroutine 1 [running]: reflect.MakeSlice(0x566460, 0x513e20, 0x4, 0x4, 0x4ead48, 0x510560, 0x8) /usr/local/go/src/reflect/value.go:2256 +0x1d8 github.com/pelletier/go-toml.(*Decoder).valueFromOtherSlice(0xc00011ff10, 0x566460, 0x513e20, 0xc000022240, 0x4, 0x4, 0xc00011f838, 0xc00011f6a0, 0x4c99b3, 0xc0001101e0, ...) /projects/go-toml/marshal.go:786 +0x5f github.com/pelletier/go-toml.(*Decoder).valueFromToml(0xc00011ff10, 0x566460, 0x513e20, 0x50dee0, 0xc00000c260, 0xc00000c280, 0x191, 0x0, 0x0, 0xc000014200, ...) /projects/go-toml/marshal.go:856 +0x527 github.com/pelletier/go-toml.(*Decoder).valueFromTree(0xc00011ff10, 0x566460, 0x51c080, 0xc000068480, 0xc00011fe10, 0x199, 0xc00005c2a0, 0x0, 0xc00011fdb0, 0x4f2dba) /projects/go-toml/marshal.go:694 +0x1174 github.com/pelletier/go-toml.(*Decoder).unmarshal(0xc00011ff10, 0x50a900, 0xc0000141f8, 0xc000068480, 0x0) /projects/go-toml/marshal.go:638 +0x275 github.com/pelletier/go-toml.(*Tree).Unmarshal(...) /projects/go-toml/marshal.go:525 main.main() /projects/go-toml/cmd/example/main.go:18 +0x13f
To Reproduce
type element struct { Color [4]uint8 } tree, _ := toml.Load(`color = [1,2,3,4]`) var e element err := tree.Unmarshal(&e) if err != nil { fmt.Println("unmarshal error:", err) }
Expected behavior There should be no panic.
Versions
Additional context None.
The text was updated successfully, but these errors were encountered:
Fix unmarshaling arrays (#385)
cc3100c
Fixes #384
Successfully merging a pull request may close this issue.
Describe the bug
Unmarshaling panics:
To Reproduce
Expected behavior
There should be no panic.
Versions
Additional context
None.
The text was updated successfully, but these errors were encountered: