mitchellh / mapstructure

Go library for decoding generic map values into native Go structures and vice versa.
https://gist.github.com/mitchellh/90029601268e59a29e64e55bab1c5bdc
MIT License
7.89k stars 669 forks source link

Unable to unmarshal custom type hcl data #317

Open RATANAJANGIR opened 1 year ago

RATANAJANGIR commented 1 year ago

Struct format

type (
    Specification struct {
        Environment
        Templates
    }

    Environment struct {
        Build   image.Image
        Runtime image.Image
    }

    Templates struct {
        ArtifactPathTemplate          string                      `mapstructure:"artifact-path"`
        StartCommandTemplate          *executable.TemplateCommand `mapstructure:"start-command"`
        ComponentInstallationTemplate *executable.TemplateCommand `mapstructure:"component-install"`
        ExecutableBinary              string                      `mapstructure:"executable-binary"`
    }
)

getting error error decoding 'Specification': unsupported entry[type= []map[string]interface {}, value= ] Anyone can help how to decode these value