Skip to content

Feature request: Unmarshaling #613

@milkpirate

Description

@milkpirate

I'd like to unmarchal a YAML config into a struct holding a MIME field.

type Cfg struct {
	Mime           mimetype.MIME  `yaml:"mime" json:"mime" default:"application/json"`
}

Doing so produces:

yaml: unmarshal errors:
	  line 1: cannot unmarshal !!str `applica...` into mimetype.MIME
panic: json: cannot unmarshal string into Go struct field Cfg.mime of type mimetype.MIME

Could you add the corresponding unmarchaling function?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions