Implement fmt.Stringer and alias ToString (#73)
This commit is contained in:
committed by
Thomas Pelletier
parent
8e6ab94eec
commit
c187221f01
@@ -108,9 +108,14 @@ func (t *TomlTree) toToml(indent, keyspace string) string {
|
|||||||
return result
|
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.
|
// ToString generates a human-readable representation of the current tree.
|
||||||
// Output spans multiple lines, and is suitable for ingest by a TOML parser
|
// 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("", "")
|
return t.toToml("", "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user