From c187221f01fcd47271e3afac7a22b54318abae2b Mon Sep 17 00:00:00 2001 From: Sam Broughton Date: Mon, 6 Jun 2016 09:23:55 +0100 Subject: [PATCH] Implement fmt.Stringer and alias ToString (#73) --- tomltree_conversions.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tomltree_conversions.go b/tomltree_conversions.go index caa2b4a3..21fb4d57 100644 --- a/tomltree_conversions.go +++ b/tomltree_conversions.go @@ -108,9 +108,14 @@ func (t *TomlTree) toToml(indent, keyspace string) string { return result } +// ToString is an alias for String +func (t *TomlTree) ToString() string { + return t.String() +} + // ToString generates a human-readable representation of the current tree. // Output spans multiple lines, and is suitable for ingest by a TOML parser -func (t *TomlTree) ToString() string { +func (t *TomlTree) String() string { return t.toToml("", "") }