From 4f002f3f263bde1e235cc64a9fea0866c29e5346 Mon Sep 17 00:00:00 2001 From: karantin2020 Date: Tue, 1 Jan 2019 11:57:16 +0500 Subject: [PATCH] Added env options example to README file --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c860ee0..2ab37d3 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Confita is a library that loads configuration from multiple backends and stores ## Install ```sh -go get -u github.com/heetch/confita +go get -u github.com/karantin2020/confita ``` ## Usage @@ -95,7 +95,10 @@ A loader can take other configured backends as parameters. ```go loader := confita.NewLoader( - env.NewBackend(), + env.NewBackend( + env.WithPrefix("PREFIX"), + env.ToUpper(), + ), file.NewBackend("/path/to/config.json"), file.NewBackend("/path/to/config.yaml"), flags.NewBackend(), @@ -124,7 +127,6 @@ err := loader.Load(ctx, &cfg) If a key is not found, Confita won't change the respective struct field. With that in mind, default values can simply be implemented by filling the structure before passing it to Confita. ```go - type Config struct { Host string `config:"host"` Port uint32 `config:"port"`