Skip to content

Sample scripts to parse HashiCorp Configuration Language (HCL).

License

Notifications You must be signed in to change notification settings

ohsawa0515/hcl_parse_sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hcl_parse_sample

Sample scripts to parse and generate HashiCorp Configuration Language (HCL).

$ go get -u github.com/golang/dep/cmd/dep
$ dep ensure
$ go run main.go
2017/09/08 11:11:39 --- Parsing HCL ---
foo = "bar"
xyz = "abc"

somelist = [
  "one",
  "two",
]

somemap = {
  foo = "bar"
  baz = "qux"
}
2017/09/08 11:11:39 --- Operate the elements ---
2017/09/08 11:11:39 foo: bar
2017/09/08 11:11:39 xyz: abc
2017/09/08 11:11:39 somelist: [one two]
2017/09/08 11:11:39 somemap: map[foo:bar baz:qux]
2017/09/08 11:11:39 variables.Foo = "baz"
2017/09/08 11:11:39 variables.Xyz = "def"
2017/09/08 11:11:39 variables.Somelist = append(variables.Somelist, "three")
2017/09/08 11:11:39 variables.Somemap["quux"] = "corge"
2017/09/08 11:11:39 --- Generate HCL ---
"foo" = "baz"

"xyz" = "def"

"somelist" = ["one", "two", "three"]

"somemap" = {
  "baz" = "qux"

  "foo" = "bar"

  "quux" = "corge"
}

About

Sample scripts to parse HashiCorp Configuration Language (HCL).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages