blob: cb2b49e6de614ea6415881e025f475b61ebfd4f7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
package scl
import "github.com/hashicorp/hcl"
/*
DecodeFile reads the given input file and decodes it into the structure given by `out`.
*/
func DecodeFile(out interface{}, path string) error {
parser, err := NewParser(NewDiskSystem())
if err != nil {
return err
}
if err := parser.Parse(path); err != nil {
return err
}
return hcl.Decode(out, parser.String())
}
|