2
0

Update README.md

This commit is contained in:
eschao 2017-12-30 15:54:00 +08:00 committed by GitHub
parent 9e933b3024
commit 1462bafb6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -162,7 +162,7 @@ When default values are defined in tags, calls ```config.ParseDefault(interface{
logConfig := Log{} logConfig := Log{}
config.ParseDefault(&logConfig) config.ParseDefault(&logConfig)
``` ```
>Note: Other parsing functions won't set structure instance with default values whatever if the configuration value is provided or not >Note: Other parsing functions don't set structure instance with default values whatever if the configuration value is provided or not
#### 2. Parses from Environment variables #### 2. Parses from Environment variables
```golang ```golang
@ -201,7 +201,7 @@ Run application like:
```shell ```shell
./main -c config.json ./main -c config.json
``` ```
**ParseConfig()** will analyze command line argument and extract **config.json** from argument **-c** **ParseConfig()** will analyze command line arguments and get configure file: **config.json** from argument **-c**
### III. Multi-Configurations ### III. Multi-Configurations
You can define all supported configuration tags in a structure and call corresponding functions in your desired order to parse. You can define all supported configuration tags in a structure and call corresponding functions in your desired order to parse.
@ -252,7 +252,7 @@ Then, you can parse as below:
... ...
``` ```
You don't need call all of them. Invokes parsing function that your need. You don't need to call all of them. Just invokes parsing function that your need.
## License ## License
This project is licensed under the Apache License Version 2.0. This project is licensed under the Apache License Version 2.0.