mirror of
https://github.com/taigrr/wtf
synced 2026-03-25 12:42:21 -07:00
Add gerrit widget
This commit is contained in:
8
vendor/github.com/olebedev/config/doc.go
generated
vendored
8
vendor/github.com/olebedev/config/doc.go
generated
vendored
@@ -6,7 +6,7 @@
|
||||
Package config provides convenient access methods to configuration stored as
|
||||
JSON or YAML.
|
||||
|
||||
Let's start with a simple YAML example:
|
||||
Let's start with a simple YAML file config.yml:
|
||||
|
||||
development:
|
||||
database:
|
||||
@@ -23,6 +23,12 @@ Let's start with a simple YAML example:
|
||||
We can parse it using ParseYaml(), which will return a *Config instance on
|
||||
success:
|
||||
|
||||
file, err := ioutil.ReadFile("config.yml")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
yamlString := string(file)
|
||||
|
||||
cfg, err := config.ParseYaml(yamlString)
|
||||
|
||||
An equivalent JSON configuration could be built using ParseJson():
|
||||
|
||||
Reference in New Issue
Block a user