yaml.Marshal panics when serialising [10]bool #144

Open
davecheney opened this Issue Nov 9, 2015 · 2 comments

Comments

Projects
None yet
3 participants

yaml.Marshal will panic when fed this value

v := struct{ A, B [10]bool } { } 
PANIC: yaml_test.go:74: yamlSuite.TestWriteYamlWriteGarbage

... Panic: Can't marshal type: [10]bool (PC=0x45B90E)

/home/dfc/go/src/runtime/asm_amd64.s:471
  in call32
/home/dfc/go/src/runtime/panic.go:423
  in gopanic
/home/dfc/src/gopkg.in/yaml.v1/yaml.go:28
  in handleErr
/home/dfc/go/src/runtime/asm_amd64.s:471
  in call32
/home/dfc/go/src/runtime/panic.go:423
  in gopanic
/home/dfc/src/gopkg.in/yaml.v1/encode.go:108
  in encoder.marshal
/home/dfc/src/gopkg.in/yaml.v1/encode.go:141
  in encoder.structv.func1
/home/dfc/src/gopkg.in/yaml.v1/encode.go:155
  in encoder.mappingv
/home/dfc/src/gopkg.in/yaml.v1/encode.go:143
  in encoder.structv
/home/dfc/src/gopkg.in/yaml.v1/encode.go:90
  in encoder.marshal
/home/dfc/src/gopkg.in/yaml.v1/yaml.go:143
  in Marshal

Why doesn't yaml.Marshal return this as an error ?

aanm commented Jan 9, 2016

Same with [2]int

panic: cannot marshal type: [2]int [recovered]
        panic: cannot marshal type: [2]int [recovered]
        panic: cannot marshal type: [2]int

vinzenz pushed a commit to vinzenz/yaml that referenced this issue Nov 2, 2016

Fix for issue go-yaml/yaml#144
Signed-off-by: Vinzenz Feenstra <evilissmo@redhat.com>

vinzenz commented Nov 2, 2016

This is a duplicate of #130 I can see now

vinzenz pushed a commit to vinzenz/yaml that referenced this issue Nov 3, 2016

Fix for issue go-yaml/yaml#144
Signed-off-by: Vinzenz Feenstra <evilissmo@redhat.com>

vinzenz pushed a commit to vinzenz/yaml that referenced this issue Mar 27, 2017

Fix for issue go-yaml/yaml#144
Signed-off-by: Vinzenz Feenstra <evilissmo@redhat.com>

vinzenz pushed a commit to vinzenz/yaml that referenced this issue Sep 20, 2017

Fix for issue go-yaml/yaml#144
Signed-off-by: Vinzenz Feenstra <evilissmo@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment