diff options
author | lawl <github@dumbinter.net> | 2022-01-06 09:51:08 +0200 |
---|---|---|
committer | lawl <github@dumbinter.net> | 2022-01-06 16:04:00 +0530 |
commit | 38787e4195f2a34d7ec4421caf17cb99bc31fa2b (patch) | |
tree | 1baab139993dcf5b851d16b3628bdb8339007ace /vendor/github.com/BurntSushi/toml/decode_go116.go | |
parent | 4aca9e658874f8c72fff3a03039de40e294d1822 (diff) | |
download | noisetorch-38787e4195f2a34d7ec4421caf17cb99bc31fa2b.tar.gz noisetorch-38787e4195f2a34d7ec4421caf17cb99bc31fa2b.zip |
Chore: Upgrade toml dependency
Diffstat (limited to 'vendor/github.com/BurntSushi/toml/decode_go116.go')
-rw-r--r-- | vendor/github.com/BurntSushi/toml/decode_go116.go | 18 |
1 files changed, 18 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..38aa75f --- /dev/null +++ b/vendor/github.com/BurntSushi/toml/decode_go116.go @@ -0,0 +1,18 @@ +// +build go1.16 + +package toml + +import ( + "io/fs" +) + +// DecodeFS is just like Decode, except it will automatically read the contents +// of the file at `path` from a fs.FS instance. +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) +} |