Skip to content

Commit

Permalink
Implement fmt.Stringer and alias ToString (BurntSushi#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
samb1729 authored and pelletier committed Jun 6, 2016
1 parent 8e6ab94 commit c187221
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tomltree_conversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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("", "")
}

Expand Down

0 comments on commit c187221

Please sign in to comment.