summaryrefslogtreecommitdiffstats
path: root/tpl/transform
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-10-20 17:38:49 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-10-22 20:46:14 +0200
commiteb038cfa0a8ada29dfcba1204ec5c432da9ed7e0 (patch)
tree9ed33e3517e49ef16f349b70b328feff47ee60d3 /tpl/transform
parent129c27ee6e9fed98dbfebeaa272fd52757b475b2 (diff)
Convert the rest to new page parser code paths
And remove some now unused code. See #5324
Diffstat (limited to 'tpl/transform')
-rw-r--r--tpl/transform/remarshal.go14
1 files changed, 4 insertions, 10 deletions
diff --git a/tpl/transform/remarshal.go b/tpl/transform/remarshal.go
index d5fe96ac6..fd0742b7f 100644
--- a/tpl/transform/remarshal.go
+++ b/tpl/transform/remarshal.go
@@ -49,18 +49,12 @@ func (ns *Namespace) Remarshal(format string, data interface{}) (string, error)
return result.String(), nil
}
-func toFormatMark(format string) (rune, error) {
- // TODO(bep) the parser package needs a cleaning.
- switch format {
- case "yaml":
- return rune(parser.YAMLLead[0]), nil
- case "toml":
- return rune(parser.TOMLLead[0]), nil
- case "json":
- return rune(parser.JSONLead[0]), nil
+func toFormatMark(format string) (metadecoders.Format, error) {
+ if f := metadecoders.FormatFromString(format); f != "" {
+ return f, nil
}
- return 0, errors.New("failed to detect target data serialization format")
+ return "", errors.New("failed to detect target data serialization format")
}
func detectFormat(data string) (metadecoders.Format, error) {