Skip to content

Commit

Permalink
update example methods and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Jul 15, 2018
1 parent 57c9e51 commit e07b8b9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

golang application config manage implement.

- generic api `Get` `GetInt` `GetString` `GetBool` `GetStringArr` ...
- support file format: `json`(default), `yaml`, `toml`
- generic api `Get` `GetInt` `GetString` `GetBool` `GetStringArr` `GetStringMap` ...
- support multi format: `json`(default), `yaml`, `toml`
- support multi file/data load
- support data override merge
- support get sub value by path, like `map.key` `arr.2`
Expand Down
8 changes: 4 additions & 4 deletions config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ arr1:
- val21
`

func ExampleUseYaml() {
func Example_useYaml() {
// add yaml decoder
SetDecoder(Yaml, yaml.Decoder)
err := LoadFiles("testdata/yml_other.yml")
Expand All @@ -31,7 +31,7 @@ func ExampleUseYaml() {
}

// load from string
LoadSources(Yaml, []byte(tomlStr))
LoadSources(Yaml, []byte(yamlStr))

fmt.Print("get config example:\n")

Expand Down Expand Up @@ -88,7 +88,7 @@ name = "Tom Preston-Werner"
org = "GitHub"
`

func ExampleUseToml() {
func Example_useToml() {
SetOptions(&Options{
ParseEnv: true,
})
Expand Down Expand Up @@ -161,7 +161,7 @@ func ExampleConfig_DefBool() {
// get 'debug' with default, val: true
}

func ExampleExportConfig() {
func Example_exportConfig() {
// Notice: before dump please set driver encoder
SetEncoder(Yaml, yaml.Encoder)

Expand Down
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Here using the yaml format as an example(yml_other.yml):
- val1
- val21
usage please see example:
usage please see examples:
*/
package config

0 comments on commit e07b8b9

Please sign in to comment.