Update to new go-toml API

Closes #3142
This commit is contained in:
Bjørn Erik Pedersen 2017-03-15 08:04:52 +01:00 committed by GitHub
parent d6093aba4d
commit d8923eb676
2 changed files with 12 additions and 10 deletions

View file

@ -52,12 +52,13 @@ func InterfaceToConfig(in interface{}, mark rune, w io.Writer) error {
return err return err
case rune(TOMLLead[0]): case rune(TOMLLead[0]):
tree := toml.TreeFromMap(in.(map[string]interface{})) tree, err := toml.TreeFromMap(in.(map[string]interface{}))
b := []byte(tree.String()) if err != nil {
_, err := w.Write(b)
return err return err
}
_, err = tree.WriteTo(w)
return err
case rune(JSONLead[0]): case rune(JSONLead[0]):
b, err := json.MarshalIndent(in, "", " ") b, err := json.MarshalIndent(in, "", " ")
if err != nil { if err != nil {
@ -107,6 +108,7 @@ func InterfaceToFrontMatter(in interface{}, mark rune, w io.Writer) error {
} }
err = InterfaceToConfig(in, mark, w) err = InterfaceToConfig(in, mark, w)
if err != nil { if err != nil {
return err return err
} }

12
vendor/vendor.json vendored
View file

@ -208,16 +208,16 @@
"revisionTime": "2016-07-26T15:08:25Z" "revisionTime": "2016-07-26T15:08:25Z"
}, },
{ {
"checksumSHA1": "8Y05Pz7onrQPcVWW6JStSsYRh6E=", "checksumSHA1": "F1IYMLBLAZaTOWnmXsgaxTGvrWI=",
"path": "github.com/pelletier/go-buffruneio", "path": "github.com/pelletier/go-buffruneio",
"revision": "df1e16fde7fc330a0ca68167c23bf7ed6ac31d6d", "revision": "c37440a7cf42ac63b919c752ca73a85067e05992",
"revisionTime": "2016-01-24T19:35:03Z" "revisionTime": "2017-02-27T22:03:11Z"
}, },
{ {
"checksumSHA1": "Ur3oHB8hzTudM8y0xHRoUXAf0IY=", "checksumSHA1": "JzPq88RYNDhkMIiCkM0NDK+0HOI=",
"path": "github.com/pelletier/go-toml", "path": "github.com/pelletier/go-toml",
"revision": "439fbba1f887c286024370cb4f281ba815c4c7d7", "revision": "fee7787d3f811af92276f5ff10107092e95b7a1d",
"revisionTime": "2016-12-29T18:51:04Z" "revisionTime": "2017-03-14T20:16:40Z"
}, },
{ {
"checksumSHA1": "ynJSWoF6v+3zMnh9R0QmmG6iGV8=", "checksumSHA1": "ynJSWoF6v+3zMnh9R0QmmG6iGV8=",