mirror of
https://github.com/Luzifer/rconfig.git
synced 2024-11-09 00:10:07 +00:00
Add hint for go modules to v2
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
d38bbb45e0
commit
28374b7f19
1 changed files with 6 additions and 0 deletions
|
@ -58,6 +58,12 @@ func main() {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
In Go 1.11 support for Go modules was added. To import the current version using Go modules use this import:
|
||||||
|
|
||||||
|
```go
|
||||||
|
import rconfig "github.com/Luzifer/rconfig/v2"
|
||||||
|
```
|
||||||
|
|
||||||
### Provide variable defaults by using a file
|
### Provide variable defaults by using a file
|
||||||
|
|
||||||
Given you have a file `~/.myapp.yml` containing some secrets or usernames (for the example below username is assumed to be "luzifer") as a default configuration for your application you can use this source code to load the defaults from that file using the `vardefault` tag in your configuration struct.
|
Given you have a file `~/.myapp.yml` containing some secrets or usernames (for the example below username is assumed to be "luzifer") as a default configuration for your application you can use this source code to load the defaults from that file using the `vardefault` tag in your configuration struct.
|
||||||
|
|
Loading…
Reference in a new issue