You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The test below illustrates the problem.
A struct containing a logrus.Level member encodes with JSON,
but decoding results in an error.
(Removing Level's UnmarshalText function seems to solve this issue, though it might be undesirable)
func TestJson(t *testing.T) {
type X struct {
Level logrus.Level
}
var x X
x.Level = logrus.WarnLevel
var buf bytes.Buffer
enc := json.NewEncoder(&buf)
assert.NoError(t, enc.Encode(x))
dec := json.NewDecoder(&buf)
var y X
assert.NoError(t, dec.Decode(&y))
}
The text was updated successfully, but these errors were encountered:
The test below illustrates the problem.
A struct containing a logrus.Level member encodes with JSON,
but decoding results in an error.
(Removing Level's UnmarshalText function seems to solve this issue, though it might be undesirable)
The text was updated successfully, but these errors were encountered: