Skip to content

Commit

Permalink
added example for documentation on how *Config.String() works
Browse files Browse the repository at this point in the history
  • Loading branch information
derdon committed Mar 27, 2013
1 parent 36ceff5 commit 67add40
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions parser_test.go
@@ -1,6 +1,7 @@
package ini

import (
"fmt"
"strings"
"testing"
)
Expand Down Expand Up @@ -192,3 +193,11 @@ func TestStringSectionWithItem(t *testing.T) {
t.Errorf("expected %q, got %q", expectedStr, stringedConfig)
}
}

func ExampleConfig_String() {
conf, _ := NewConfigFromString("[section]\n\tfoo \t = bar ")
fmt.Println(conf)
// Output:
// [section]
// foo = bar
}

0 comments on commit 67add40

Please sign in to comment.