diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2023-12-30 16:00:20 -0500 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2023-12-30 16:00:20 -0500 |
| commit | 809fc4639e58ca9ca082ce68b5c62b463b2f1e1d (patch) | |
| tree | 1cb7b9951a80509b827b8e5bd1eb2dd09e87aec1 /vendor/github.com/BurntSushi/toml/decode_go116.go | |
| parent | Initial Commit (diff) | |
| download | cli-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.go | 19 |
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) +} |