Skip to content

Commit bb47f05

Browse files
committed
Merge branch 'master' of github.com:antelman107/json-env-go
2 parents 2fdd22e + 579c3b5 commit bb47f05

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ It is easy if configuration consists of simple values (strings, numbers, boolean
1717

1818
In this case we could use several environment variables like `APP_LOGIN="user" APP_PASSWORD="somepass"`.
1919

20-
But how do we work for complex configuration
21-
that consists of arrays of objects? For example:
20+
But how would we work with complex configuration that, for example, consists of arrays of objects? For example:
2221
```json
2322
{
2423
"nodes":[
@@ -36,25 +35,22 @@ that consists of arrays of objects? For example:
3635
}
3736
```
3837

39-
It is difficult to split this configuration to several environment variables.
40-
4138
This package is aimed to deal with such configs.
42-
4339
Just put the config into single environment variable.
44-
It could be multiline, but work with single line is simplier.
40+
It could be multiline, but work with single line is simplier from `bash`.
4541

46-
Running program example:
42+
Running program `bash` example:
4743

4844
```bash
4945

5046
CONFIG='{"nodes":[{"url":"http:\/\/1.localhost\/","priority":1,"enabled":true},{"url":"http:\/\/2.localhost\/","priority":2,"enabled":false}]}' ./app
5147
```
5248

53-
Program code example:
49+
GO program code example:
5450
```GO
5551
import jsonEnvGo "github.com/antelman107/json-env-go"
5652

57-
type Config struct {
53+
type Config struct {
5854
Nodes []struct {
5955
URL string `json:"url"`
6056
Priority int `json:"priority"`

0 commit comments

Comments
 (0)