From d8923eb676101aeec3e2789aa13e9dc2bb13a8bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 15 Mar 2017 08:04:52 +0100 Subject: [PATCH] Update to new go-toml API Closes #3142 --- parser/frontmatter.go | 10 ++++++---- vendor/vendor.json | 12 ++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/parser/frontmatter.go b/parser/frontmatter.go index 797c6fcf0..d97bc4c4d 100644 --- a/parser/frontmatter.go +++ b/parser/frontmatter.go @@ -52,12 +52,13 @@ func InterfaceToConfig(in interface{}, mark rune, w io.Writer) error { return err case rune(TOMLLead[0]): - tree := toml.TreeFromMap(in.(map[string]interface{})) - b := []byte(tree.String()) + tree, err := toml.TreeFromMap(in.(map[string]interface{})) + if err != nil { + return err + } - _, err := w.Write(b) + _, err = tree.WriteTo(w) return err - case rune(JSONLead[0]): b, err := json.MarshalIndent(in, "", " ") if err != nil { @@ -107,6 +108,7 @@ func InterfaceToFrontMatter(in interface{}, mark rune, w io.Writer) error { } err = InterfaceToConfig(in, mark, w) + if err != nil { return err } diff --git a/vendor/vendor.json b/vendor/vendor.json index 7891d3ef4..3bbce3f21 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -208,16 +208,16 @@ "revisionTime": "2016-07-26T15:08:25Z" }, { - "checksumSHA1": "8Y05Pz7onrQPcVWW6JStSsYRh6E=", + "checksumSHA1": "F1IYMLBLAZaTOWnmXsgaxTGvrWI=", "path": "github.com/pelletier/go-buffruneio", - "revision": "df1e16fde7fc330a0ca68167c23bf7ed6ac31d6d", - "revisionTime": "2016-01-24T19:35:03Z" + "revision": "c37440a7cf42ac63b919c752ca73a85067e05992", + "revisionTime": "2017-02-27T22:03:11Z" }, { - "checksumSHA1": "Ur3oHB8hzTudM8y0xHRoUXAf0IY=", + "checksumSHA1": "JzPq88RYNDhkMIiCkM0NDK+0HOI=", "path": "github.com/pelletier/go-toml", - "revision": "439fbba1f887c286024370cb4f281ba815c4c7d7", - "revisionTime": "2016-12-29T18:51:04Z" + "revision": "fee7787d3f811af92276f5ff10107092e95b7a1d", + "revisionTime": "2017-03-14T20:16:40Z" }, { "checksumSHA1": "ynJSWoF6v+3zMnh9R0QmmG6iGV8=",