parent
71f80e2ad2
commit
9dac7908a5
|
@ -1,24 +1,24 @@
|
||||||
// mapstructure-to-hcl2 fills the gaps between hcl2 and mapstructure for Packer
|
// mapstructure-to-hcl2 fills the gaps between hcl2 and mapstructure for Packer
|
||||||
|
//
|
||||||
// By generating a struct that the HCL2 ecosystem understands making use of
|
// By generating a struct that the HCL2 ecosystem understands making use of
|
||||||
// mapstructure tags.
|
// mapstructure tags.
|
||||||
|
//
|
||||||
// Packer heavily uses the mapstructure decoding library to load/parse user
|
// Packer heavily uses the mapstructure decoding library to load/parse user
|
||||||
// config files. Packer now needs to move to HCL2.
|
// config files. Packer now needs to move to HCL2.
|
||||||
|
//
|
||||||
// Here are a few differences/gaps betweens hcl2 and mapstructure:
|
// Here are a few differences/gaps betweens hcl2 and mapstructure:
|
||||||
|
//
|
||||||
// * in HCL2 all basic struct fields (string/int/struct) that are not pointers
|
// * in HCL2 all basic struct fields (string/int/struct) that are not pointers
|
||||||
// are required ( must be set ). In mapstructure everything is optional.
|
// are required ( must be set ). In mapstructure everything is optional.
|
||||||
|
//
|
||||||
// * mapstructure allows to 'squash' fields
|
// * mapstructure allows to 'squash' fields
|
||||||
// (ex: Field CommonStructType `mapstructure:",squash"`) this allows to
|
// (ex: Field CommonStructType `mapstructure:",squash"`) this allows to
|
||||||
// decorate structs and reuse configuration code. HCL2 parsing libs don't have
|
// decorate structs and reuse configuration code. HCL2 parsing libs don't have
|
||||||
// anything similar.
|
// anything similar.
|
||||||
|
//
|
||||||
// mapstructure-to-hcl2 will parse Packer's config files and generate the HCL2
|
// mapstructure-to-hcl2 will parse Packer's config files and generate the HCL2
|
||||||
// compliant code that will allow to not change any of the current builders in
|
// compliant code that will allow to not change any of the current builders in
|
||||||
// order to move to HCL2 to softly move to HCL2.
|
// order to softly move to HCL2.
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
Loading…
Reference in New Issue