From 86eee1211615bf99dbc864884f1a350abc832fce Mon Sep 17 00:00:00 2001 From: Lucas Kanashiro Date: Mon, 25 Jan 2021 18:51:45 -0300 Subject: [PATCH] feat: upgrade to go 1.15 (#150) * Fix escape issue in tests * Build with Golang 1.15 --- .github/workflows/build.yml | 2 +- env_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 153a32c..ac49730 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/env_test.go b/env_test.go index b1e3038..f215c73 100644 --- a/env_test.go +++ b/env_test.go @@ -605,7 +605,7 @@ 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) { @@ -613,7 +613,7 @@ func TestInvalidDurations(t *testing.T) { 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) { @@ -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) { @@ -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) {