Skip to content

Commit 8074803

Browse files
committed
update readme
1 parent c85acf2 commit 8074803

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ go get github.com/nrfta/go-config/v2
1212

1313
To load the config data into a struct you will need two parameters
1414

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
1616
2) a variable of type **"customStruct"** where customStruct is a struct you define to mirror the key values of your config
1717

1818
### Example
@@ -39,7 +39,7 @@ In the file you want to load the config in do the following:
3939
// config/config.go
4040

4141
import (
42-
"github.com/gobuffalo/packr"
42+
"github.com/gobuffalo/packr/v2"
4343
"github.com/nrfta/go-config/v2"
4444
)
4545

@@ -60,7 +60,8 @@ var (
6060
)
6161

6262
func init() {
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
6465
if err != nil {
6566
panic(err)
6667
}

0 commit comments

Comments
 (0)