Skip to content

Commit c433b2f

Browse files
committed
updated module
1 parent 5b567c0 commit c433b2f

19 files changed

+28
-25
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ the `RegisterField` function.
1111
## Example
1212

1313
```go
14+
package main
15+
16+
import (
17+
"fmt"
18+
19+
"github.com/simia-tech/env/v2"
20+
)
21+
1422
var (
1523
name = env.String("NAME", "joe")
1624
age = env.Int("AGE", 24)
@@ -20,7 +28,8 @@ var (
2028
func main() {
2129
env.ParseFlags()
2230

23-
fmt.Printf("%s is %d years old\n", name.Get(), age.Get())
31+
fmt.Printf("%s is %d years old\nshifts are %v\n",
32+
name.GetOrDefault(), age.GetOrDefault(), shifts.GetOrDefault())
2433
}
2534
```
2635

bool_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"github.com/stretchr/testify/assert"
2222
"github.com/stretchr/testify/require"
2323

24-
"github.com/simia-tech/env"
24+
"github.com/simia-tech/env/v2"
2525
)
2626

2727
func TestBool(t *testing.T) {

bytes_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"github.com/stretchr/testify/assert"
2222
"github.com/stretchr/testify/require"
2323

24-
"github.com/simia-tech/env"
24+
"github.com/simia-tech/env/v2"
2525
)
2626

2727
func TestBytes(t *testing.T) {

duration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"github.com/stretchr/testify/assert"
2323
"github.com/stretchr/testify/require"
2424

25-
"github.com/simia-tech/env"
25+
"github.com/simia-tech/env/v2"
2626
)
2727

2828
func TestDuration(t *testing.T) {

example/simple/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"fmt"
55

6-
"github.com/simia-tech/env"
6+
"github.com/simia-tech/env/v2"
77
)
88

99
var (

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
module github.com/simia-tech/env
1+
module github.com/simia-tech/env/v2
22

33
require (
44
github.com/davecgh/go-spew v1.1.1 // indirect
5-
github.com/pmezard/go-difflib v1.0.0 // indirect
6-
github.com/stretchr/objx v0.3.0 // indirect
75
github.com/stretchr/testify v1.7.0
86
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
97
)

go.sum

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
44
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
55
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
66
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
7-
github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As=
8-
github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
9-
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
10-
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
11-
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
127
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
138
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
9+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
1410
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
1511
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
1612
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=

int_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"github.com/stretchr/testify/assert"
2222
"github.com/stretchr/testify/require"
2323

24-
"github.com/simia-tech/env"
24+
"github.com/simia-tech/env/v2"
2525
)
2626

2727
func TestInt(t *testing.T) {

internal/parser/ints_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"github.com/stretchr/testify/assert"
77
"github.com/stretchr/testify/require"
88

9-
"github.com/simia-tech/env/internal/parser"
9+
"github.com/simia-tech/env/v2/internal/parser"
1010
)
1111

1212
func TestParseInts(t *testing.T) {

internal/parser/string_map_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"github.com/stretchr/testify/assert"
77
"github.com/stretchr/testify/require"
88

9-
"github.com/simia-tech/env/internal/parser"
9+
"github.com/simia-tech/env/v2/internal/parser"
1010
)
1111

1212
func TestParseStringMap(t *testing.T) {

internal/parser/strings_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"github.com/stretchr/testify/assert"
77
"github.com/stretchr/testify/require"
88

9-
"github.com/simia-tech/env/internal/parser"
9+
"github.com/simia-tech/env/v2/internal/parser"
1010
)
1111

1212
func TestParseStrings(t *testing.T) {

ints.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"strconv"
1919
"strings"
2020

21-
"github.com/simia-tech/env/internal/parser"
21+
"github.com/simia-tech/env/v2/internal/parser"
2222
)
2323

2424
// IntsField implements a ints field.

ints_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"github.com/stretchr/testify/assert"
2222
"github.com/stretchr/testify/require"
2323

24-
"github.com/simia-tech/env"
24+
"github.com/simia-tech/env/v2"
2525
)
2626

2727
func TestInts(t *testing.T) {

print_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"github.com/stretchr/testify/assert"
2222
"github.com/stretchr/testify/require"
2323

24-
"github.com/simia-tech/env"
24+
"github.com/simia-tech/env/v2"
2525
)
2626

2727
func TestPrint(t *testing.T) {

string_map.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ package env
1717
import (
1818
"fmt"
1919

20-
"github.com/simia-tech/env/internal/parser"
20+
"github.com/simia-tech/env/v2/internal/parser"
2121
)
2222

2323
// StringMapField implements a map of strings.

string_map_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"github.com/stretchr/testify/assert"
2222
"github.com/stretchr/testify/require"
2323

24-
"github.com/simia-tech/env"
24+
"github.com/simia-tech/env/v2"
2525
)
2626

2727
func TestStringMap(t *testing.T) {

string_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"github.com/stretchr/testify/assert"
2222
"github.com/stretchr/testify/require"
2323

24-
"github.com/simia-tech/env"
24+
"github.com/simia-tech/env/v2"
2525
)
2626

2727
func TestString(t *testing.T) {

strings.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ package env
1717
import (
1818
"strings"
1919

20-
"github.com/simia-tech/env/internal/parser"
20+
"github.com/simia-tech/env/v2/internal/parser"
2121
)
2222

2323
const separator = ","

strings_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"github.com/stretchr/testify/assert"
2222
"github.com/stretchr/testify/require"
2323

24-
"github.com/simia-tech/env"
24+
"github.com/simia-tech/env/v2"
2525
)
2626

2727
func TestStrings(t *testing.T) {

0 commit comments

Comments
 (0)