Update to new go-toml API
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 15 Mar 2017 07:04:52 +0000 (08:04 +0100)
committerGitHub <noreply@github.com>
Wed, 15 Mar 2017 07:04:52 +0000 (08:04 +0100)
Closes #3142

parser/frontmatter.go
vendor/vendor.json

index 797c6fcf01a4e48aafb136e605acd8fe3b13fbca..d97bc4c4d5cc0c34b678ec579b0c48c449a3cc3a 100644 (file)
@@ -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
                }
index 7891d3ef40c4edd2bb9838963c82640d9e514259..3bbce3f2117e8ca446c3ab2ba3f9174ce83c15ea 100644 (file)
                        "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=",