-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Running the autofix via golangci-lint will convert this code:
func TestInvalidJSON(t *testing.T) {
invalidJSON := []byte(`{invalid json`)
results, err := Explode(&http.Request{}, invalidJSON)
require.NoError(t, err, "should not return error for invalid JSON, just return original")
require.Len(t, results, 1, "should return original bytes when JSON is invalid")
assert.Equal(t, string(invalidJSON), string(results[0]), "should return original bytes unchanged")
}to
func TestInvalidJSON(t *testing.T) {
invalidJSON := []byte(`{invalid json`)
results, err := Explode(&http.Request{}, invalidJSON)
require.NoError(t, err, "should not return error for invalid JSON, just return original")
require.Len(t, results, 1, "should return original bytes when JSON is invalid")
assert.JSONEq(t, string(invalidJSON), string(results[0]), "should return original bytes unchanged")
}but because the json is invalid we get an fail
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels