Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

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

@davecheney

Description

@davecheney

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions