Skip to content

Instantly share code, notes, and snippets.

@aaronhurt
Last active April 17, 2018 22:05
Show Gist options
  • Select an option

  • Save aaronhurt/a2014233e683538e1165a0e6d8578734 to your computer and use it in GitHub Desktop.

Select an option

Save aaronhurt/a2014233e683538e1165a0e6d8578734 to your computer and use it in GitHub Desktop.

Revisions

  1. aaronhurt revised this gist Apr 17, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion foo.go
    Original file line number Diff line number Diff line change
    @@ -24,5 +24,5 @@ type fooBar struct {
    func main() {
    fb := &fooBar{}
    err := hcl.Decode(fb, myHCL)
    fmt.Printf("out: %+v\nlen: %d\nerr: %s,", fb, len(fb.Foo.Bar), err)
    fmt.Printf("out: %+v\nlen: %d\nerr: %s", fb, len(fb.Foo.Bar), err)
    }
  2. aaronhurt revised this gist Apr 17, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion foo.go
    Original file line number Diff line number Diff line change
    @@ -24,5 +24,5 @@ type fooBar struct {
    func main() {
    fb := &fooBar{}
    err := hcl.Decode(fb, myHCL)
    fmt.Printf("out: %+v\nerr: %s", fb, err)
    fmt.Printf("out: %+v\nlen: %d\nerr: %s,", fb, len(fb.Foo.Bar), err)
    }
  3. aaronhurt created this gist Apr 17, 2018.
    28 changes: 28 additions & 0 deletions foo.go
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    package main

    import (
    "fmt"
    "github.com/hashicorp/hcl"
    )

    const myHCL = `foo {
    bar = [<<EOF
    "adsf asdf"
    EOF
    , <<EOF
    asdf asdf,
    EOF
    ]
    }`

    type fooBar struct {
    Foo struct {
    Bar []string
    }
    }

    func main() {
    fb := &fooBar{}
    err := hcl.Decode(fb, myHCL)
    fmt.Printf("out: %+v\nerr: %s", fb, err)
    }