Implement fmt.Stringer and alias ToString (#73)
diff --git a/tomltree_conversions.go b/tomltree_conversions.go
index caa2b4a..21fb4d5 100644
--- a/tomltree_conversions.go
+++ b/tomltree_conversions.go
@@ -108,9 +108,14 @@
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("", "")
}