Skip to content

Are embedded structs supported? #35

@milkpirate

Description

@milkpirate

I have structs similar to:

type Foo struct {
	Bar string `fig:"bar"`
}

type Config struct {
	*Foo
	Baz string `fig:"baz"`
}

And a config file like so:

# config.yaml
bar: barBar
baz: bazBaz

fig loads the config as follows:

(main.Config) {
 Foo: (*main.Foo)(<nil>),
 Baz: (string) (len=6) "bazBaz"
}

but I would hope to get:

(main.Config) {
 Foo: (*main.Foo)(0xc0000289a0)({
  Bar: (string) (len=6) "barBar"
 }),
 Baz: (string) (len=6) "bazBaz"
}

Is there a workaround or a setting I need to tweak?

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