Skip to content

Commit

Permalink
feat: upgrade to go 1.15 (caarlos0#150)
Browse files Browse the repository at this point in the history
* Fix escape issue in tests

* Build with Golang 1.15
  • Loading branch information
nexoscp committed Jan 25, 2021
1 parent 60ba4a7 commit 86eee12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
go-version: 1.15
-
name: Cache Go modules
uses: actions/cache@v2
Expand Down
8 changes: 4 additions & 4 deletions env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,15 +605,15 @@ func TestInvalidDuration(t *testing.T) {
defer os.Clearenv()

cfg := Config{}
assert.EqualError(t, Parse(&cfg), "env: parse error on field \"Duration\" of type \"time.Duration\": unable to parse duration: time: invalid duration should-be-a-valid-duration")
assert.EqualError(t, Parse(&cfg), "env: parse error on field \"Duration\" of type \"time.Duration\": unable to parse duration: time: invalid duration \"should-be-a-valid-duration\"")
}

func TestInvalidDurations(t *testing.T) {
os.Setenv("DURATIONS", "1s,contains-an-invalid-duration,3s")
defer os.Clearenv()

cfg := Config{}
assert.EqualError(t, Parse(&cfg), "env: parse error on field \"Durations\" of type \"[]time.Duration\": unable to parse duration: time: invalid duration contains-an-invalid-duration")
assert.EqualError(t, Parse(&cfg), "env: parse error on field \"Durations\" of type \"[]time.Duration\": unable to parse duration: time: invalid duration \"contains-an-invalid-duration\"")
}

func TestParseStructWithoutEnvTag(t *testing.T) {
Expand Down Expand Up @@ -989,7 +989,7 @@ func TestTextUnmarshalerError(t *testing.T) {
}
os.Setenv("UNMARSHALER", "invalid")
cfg := &config{}
assert.EqualError(t, Parse(cfg), "env: parse error on field \"Unmarshaler\" of type \"env.unmarshaler\": time: invalid duration invalid")
assert.EqualError(t, Parse(cfg), "env: parse error on field \"Unmarshaler\" of type \"env.unmarshaler\": time: invalid duration \"invalid\"")
}

func TestTextUnmarshalersError(t *testing.T) {
Expand All @@ -998,7 +998,7 @@ func TestTextUnmarshalersError(t *testing.T) {
}
os.Setenv("UNMARSHALERS", "1s,invalid")
cfg := &config{}
assert.EqualError(t, Parse(cfg), "env: parse error on field \"Unmarshalers\" of type \"[]env.unmarshaler\": time: invalid duration invalid")
assert.EqualError(t, Parse(cfg), "env: parse error on field \"Unmarshalers\" of type \"[]env.unmarshaler\": time: invalid duration \"invalid\"")
}

func TestParseURL(t *testing.T) {
Expand Down

0 comments on commit 86eee12

Please sign in to comment.