aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/BurntSushi/toml/decode_go116.go
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2023-12-30 16:00:20 -0500
committerEugene Triguba <eugenetriguba@gmail.com>2023-12-30 16:00:20 -0500
commit809fc4639e58ca9ca082ce68b5c62b463b2f1e1d (patch)
tree1cb7b9951a80509b827b8e5bd1eb2dd09e87aec1 /vendor/github.com/BurntSushi/toml/decode_go116.go
parentInitial Commit (diff)
downloadcli-809fc4639e58ca9ca082ce68b5c62b463b2f1e1d.zip
Add initial code
Diffstat (limited to 'vendor/github.com/BurntSushi/toml/decode_go116.go')
-rw-r--r--vendor/github.com/BurntSushi/toml/decode_go116.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/vendor/github.com/BurntSushi/toml/decode_go116.go b/vendor/github.com/BurntSushi/toml/decode_go116.go
new file mode 100644
index 0000000..086d0b6
--- /dev/null
+++ b/vendor/github.com/BurntSushi/toml/decode_go116.go
@@ -0,0 +1,19 @@
+//go:build go1.16
+// +build go1.16
+
+package toml
+
+import (
+ "io/fs"
+)
+
+// DecodeFS reads the contents of a file from [fs.FS] and decodes it with
+// [Decode].
+func DecodeFS(fsys fs.FS, path string, v interface{}) (MetaData, error) {
+ fp, err := fsys.Open(path)
+ if err != nil {
+ return MetaData{}, err
+ }
+ defer fp.Close()
+ return NewDecoder(fp).Decode(v)
+}