You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ go get github.com/nrfta/go-config/v2
12
12
13
13
To load the config data into a struct you will need two parameters
14
14
15
-
1) a variable of type **box**: To get the box type you will need to import ``` github.com/gobuffalo/packr``` . The box variable will hold the config data in the binary
15
+
1) a variable of type **box**: To get the box type you will need to import ``` github.com/gobuffalo/packr/v2``` . The box variable will hold the config data in the binary
16
16
2) a variable of type **"customStruct"** where customStruct is a struct you define to mirror the key values of your config
17
17
18
18
### Example
@@ -39,7 +39,7 @@ In the file you want to load the config in do the following:
39
39
// config/config.go
40
40
41
41
import (
42
-
"github.com/gobuffalo/packr"
42
+
"github.com/gobuffalo/packr/v2"
43
43
"github.com/nrfta/go-config/v2"
44
44
)
45
45
@@ -60,7 +60,8 @@ var (
60
60
)
61
61
62
62
funcinit() {
63
-
err:= config.Load(packr.NewBox("."), &Config) // now the config data has been loaded into appConfig
63
+
box:= packr.New("config", ".")
64
+
err:= config.Load(box, &Config) // now the config data has been loaded into appConfig
0 commit comments