Convert the rest to new page parser code paths

And remove some now unused code.

See #5324
This commit is contained in:
Bjørn Erik Pedersen
2018-10-20 17:38:49 +02:00
parent 129c27ee6e
commit eb038cfa0a
14 changed files with 120 additions and 1467 deletions

View File

@@ -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) {