Skip to content

Commit

Permalink
Merge pull request #29 from golobby/v3
Browse files Browse the repository at this point in the history
V3
  • Loading branch information
miladrahimi authored Aug 20, 2021
2 parents 672d80a + a577e07 commit 91c2a26
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ func TestFeed_WithMultiple_Feeders(t *testing.T) {

c := &struct {
App struct {
Name string `dotenv:"APP_NAME" env:"APP_NAME"`
Port int `dotenv:"APP_PORT" env:"APP_PORT"`
Name string `env:"APP_NAME"`
Port int `env:"APP_PORT"`
}
Debug bool `dotenv:"DEBUG" env:"DEBUG"`
Production bool `dotenv:"PRODUCTION" env:"PRODUCTION"`
Pi float64 `dotenv:"PI" env:"PI"`
Debug bool `env:"DEBUG"`
Production bool `env:"PRODUCTION"`
Pi float64 `env:"PI"`
}{}

f1 := feeder.Json{Path: "assets/sample1.json"}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/golobby/config/v3
go 1.11

require (
github.com/golobby/dotenv v1.1.0
github.com/golobby/dotenv v1.2.0
github.com/golobby/env/v2 v2.1.0
github.com/stretchr/testify v1.7.0
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/golobby/cast v1.1.4 h1:AJ5mNMUOnbha2XWpQIPwnAcahBRB3/ENugWsDM69VgU=
github.com/golobby/cast v1.1.4/go.mod h1:WCusT3z1fzp4XVBUGbWy61insoQS8CPJHNTQwlW8qnM=
github.com/golobby/dotenv v1.1.0 h1:SzrKTEkIQqKwm1+4zfvKIZF0ugfLDgyhoRX8iKvFwH0=
github.com/golobby/dotenv v1.1.0/go.mod h1:iEIqJeTeQQ8BwujHnTCGf4mO21OKObYFe6MsHs9fIPM=
github.com/golobby/dotenv v1.2.0 h1:kDA2zKOf9byk040lju6hcm7ma5KRPvPCiSZiSgeVcys=
github.com/golobby/dotenv v1.2.0/go.mod h1:iEIqJeTeQQ8BwujHnTCGf4mO21OKObYFe6MsHs9fIPM=
github.com/golobby/env/v2 v2.1.0 h1:szUrj5lC+WsnAEbcBzWXyRE0O3fOAI2lgI0SRwtQI9Q=
github.com/golobby/env/v2 v2.1.0/go.mod h1:UM4kv1vShjJQcC54Au2GZsQ8fauFygf+BOJpCcgy1W8=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
12 changes: 6 additions & 6 deletions pkg/feeder/dotenv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
func TestDotEnv_Feed(t *testing.T) {
type config struct {
App struct {
Name string `dotenv:"APP_NAME"`
Port int `dotenv:"APP_PORT"`
Name string `env:"APP_NAME"`
Port int `env:"APP_PORT"`
}
Debug bool `dotenv:"DEBUG"`
Production bool `dotenv:"PRODUCTION"`
Pi float64 `dotenv:"PI"`
Debug bool `env:"DEBUG"`
Production bool `env:"PRODUCTION"`
Pi float64 `env:"PI"`
}

c := config{}
Expand All @@ -41,7 +41,7 @@ func TestDotEnv_Feed_With_Invalid_File_It_Should_Fail(t *testing.T) {
func TestDotEnv_Feed_With_Invalid_Struct_It_Should_Fail(t *testing.T) {
c := struct {
App struct {
Name float64 `dotenv:"APP_NAME"`
Name float64 `env:"APP_NAME"`
}
}{}
f := feeder.DotEnv{Path: "./../../assets/.env.sample1"}
Expand Down

0 comments on commit 91c2a26

Please sign in to comment.