Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 924a1b9

Browse files
committed
fix: When using a defaults file, env variables are now mapped using the GTE_DEFAULTS_ prefix
1 parent 73debfe commit 924a1b9

File tree

5 files changed

+87
-116
lines changed

5 files changed

+87
-116
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [v1.3.4](https://github.com/cmaster11/go-to-exec/tree/v1.3.4) (2021-10-23)
4+
5+
[Full Changelog](https://github.com/cmaster11/go-to-exec/compare/v1.3.3...v1.3.4)
6+
37
## [v1.3.3](https://github.com/cmaster11/go-to-exec/tree/v1.3.3) (2021-10-23)
48

59
[Full Changelog](https://github.com/cmaster11/go-to-exec/compare/v1.3.2...v1.3.3)

docs/0020-configuration.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,13 @@ GTE_LISTENERS__HELLO_COMMAND=echo
4949
Notes:
5050

5151
* All environment variables need to be prefixed by `GTE_`.
52-
* Dynamic entries (where the key/value pairs belong to a dynamic map), like the `listeners` map, **need to be defined in the initial
53-
config**, before they can be re-mapped using environment variables.
52+
* Dynamic entries (where the key/value pairs belong to a dynamic map), like the `listeners` map, **need to be defined in
53+
the initial config**, before they can be re-mapped using environment variables.
5454
* The environment variable name for a config entry is created by:
5555
1. Join all the keys' chain with `_`: `listeners_/hello_command`
5656
2. Replace all non `a-z`, `A-Z`, `0-9`, `_` characters with `_`: `listeners__hello_command`
5757
3. Turn the whole text to upper-case: `LISTENERS__HELLO_COMMAND`
5858
4. Prefix with `GTE_`: `GTE_LISTENERS__HELLO_COMMAND`
59+
* When using a [multi part configuration](/0120-use-cases/multi-part-config.md), the `defaults` file will be mapped with
60+
the `GTE_DEFAULTS_` prefix. This means that you can use exactly the same environment variables between a `defaults`
61+
file and a normal configuration one.

go.mod

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ require (
2727
github.com/pkg/errors v0.9.1
2828
github.com/sirupsen/logrus v1.8.1
2929
github.com/spf13/cast v1.4.1
30-
github.com/spf13/viper v1.7.1
30+
github.com/spf13/viper v1.9.0
3131
github.com/stretchr/testify v1.7.0
3232
github.com/uptrace/bun v1.0.13
3333
github.com/uptrace/bun/dialect/pgdialect v1.0.13
@@ -51,7 +51,7 @@ require (
5151
github.com/dave/dst v0.26.2 // indirect
5252
github.com/dropbox/dropbox-sdk-go-unofficial/v6 v6.0.2 // indirect
5353
github.com/fatih/color v1.13.0 // indirect
54-
github.com/fsnotify/fsnotify v1.4.7 // indirect
54+
github.com/fsnotify/fsnotify v1.5.1 // indirect
5555
github.com/gin-contrib/sse v0.1.0 // indirect
5656
github.com/go-playground/locales v0.13.0 // indirect
5757
github.com/go-playground/universal-translator v0.17.0 // indirect
@@ -66,10 +66,10 @@ require (
6666
github.com/huandu/xstrings v1.3.2 // indirect
6767
github.com/jinzhu/inflection v1.0.0 // indirect
6868
github.com/jmespath/go-jmespath v0.4.0 // indirect
69-
github.com/json-iterator/go v1.1.9 // indirect
69+
github.com/json-iterator/go v1.1.11 // indirect
7070
github.com/kevinburke/go-bindata v3.22.0+incompatible // indirect
7171
github.com/leodido/go-urn v1.2.0 // indirect
72-
github.com/magiconair/properties v1.8.1 // indirect
72+
github.com/magiconair/properties v1.8.5 // indirect
7373
github.com/mattn/go-colorable v0.1.11 // indirect
7474
github.com/mattn/go-ieproxy v0.0.1 // indirect
7575
github.com/mattn/go-isatty v0.0.14 // indirect
@@ -87,9 +87,9 @@ require (
8787
github.com/russross/blackfriday/v2 v2.0.1 // indirect
8888
github.com/shopspring/decimal v1.2.0 // indirect
8989
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
90-
github.com/spf13/afero v1.1.2 // indirect
91-
github.com/spf13/jwalterweatherman v1.0.0 // indirect
92-
github.com/spf13/pflag v1.0.3 // indirect
90+
github.com/spf13/afero v1.6.0 // indirect
91+
github.com/spf13/jwalterweatherman v1.1.0 // indirect
92+
github.com/spf13/pflag v1.0.5 // indirect
9393
github.com/subosito/gotenv v1.2.0 // indirect
9494
github.com/tencentyun/cos-go-sdk-v5 v0.7.31 // indirect
9595
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect
@@ -116,10 +116,10 @@ require (
116116
google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71 // indirect
117117
google.golang.org/grpc v1.40.0 // indirect
118118
google.golang.org/protobuf v1.27.1 // indirect
119-
gopkg.in/ini.v1 v1.51.0 // indirect
119+
gopkg.in/ini.v1 v1.63.2 // indirect
120120
gopkg.in/yaml.v2 v2.4.0 // indirect
121121
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
122122
mellium.im/sasl v0.2.1 // indirect
123123
)
124124

125-
replace github.com/spf13/viper v1.7.1 => github.com/kublr/viper v1.6.3-0.20200316132607-0caa8e000d5b
125+
replace github.com/spf13/viper v1.9.0 => github.com/cmaster11/viper v1.6.3-0.20211025064843-b471e2653775

0 commit comments

Comments
 (0)