go1.14 fixes
This commit is contained in:
parent
d5a94653da
commit
f144d5c1c1
@ -97,9 +97,5 @@ func TestOriginator(t *testing.T) {
|
||||
assert.Equal(t, err, ErrInvalidOriginator)
|
||||
})
|
||||
|
||||
t.Run("MarshalJSON_Invalid", func(t *testing.T) {
|
||||
data, err := json.Marshal(Originator(3))
|
||||
assert.Nil(t, data)
|
||||
assert.EqualError(t, err, "json: error calling MarshalJSON for type v1.Originator: invalid originator")
|
||||
})
|
||||
t.Run("MarshalJSON_Invalid", OriginatorMarshalJSONInvalid)
|
||||
}
|
||||
|
16
v1/types_test_1.13.go
Normal file
16
v1/types_test_1.13.go
Normal file
@ -0,0 +1,16 @@
|
||||
// +build !go1.14
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func OriginatorMarshalJSONInvalid(t *testing.T) {
|
||||
data, err := json.Marshal(Originator(3))
|
||||
assert.Nil(t, data)
|
||||
assert.EqualError(t, err, "json: error calling MarshalJSON for type v1.Originator: invalid originator")
|
||||
}
|
16
v1/types_test_1.14.go
Normal file
16
v1/types_test_1.14.go
Normal file
@ -0,0 +1,16 @@
|
||||
// +build go1.14
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func OriginatorMarshalJSONInvalid(t *testing.T) {
|
||||
data, err := json.Marshal(Originator(3))
|
||||
assert.Nil(t, data)
|
||||
assert.EqualError(t, err, "json: error calling MarshalText for type v1.Originator: invalid originator")
|
||||
}
|
Loading…
Reference in New Issue
Block a user