aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/homemade/scl/decode.go
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2017-01-24 23:43:28 +0000
committerNiall Sheridan <nsheridan@gmail.com>2017-01-25 00:02:37 +0000
commitf635033e3e953e74d67b76a520c9760786330af5 (patch)
tree8e41d7d07c489edbfb45f1d4ffff921b2f6bc265 /vendor/github.com/homemade/scl/decode.go
parent0f4344348419ed6c3ee4236188e456d79e2d51b4 (diff)
Switch to scl, an extension of hcl
Diffstat (limited to 'vendor/github.com/homemade/scl/decode.go')
-rw-r--r--vendor/github.com/homemade/scl/decode.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/vendor/github.com/homemade/scl/decode.go b/vendor/github.com/homemade/scl/decode.go
new file mode 100644
index 0000000..cb2b49e
--- /dev/null
+++ b/vendor/github.com/homemade/scl/decode.go
@@ -0,0 +1,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())
+}