1
0
Fork 0
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:
Knut Ahlers 2019-02-04 17:11:41 +01:00
parent d38bbb45e0
commit 28374b7f19
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -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.