diff --git a/model/entry.go b/model/entry.go index d10e9740..29bc2cdc 100644 --- a/model/entry.go +++ b/model/entry.go @@ -84,12 +84,3 @@ func ValidateRange(offset, limit int) error { return nil } - -// OppositeDirection returns the opposite sorting direction. -func OppositeDirection(direction string) string { - if direction == "asc" { - return "desc" - } - - return "asc" -} diff --git a/model/entry_test.go b/model/entry_test.go index e878f94b..20534124 100644 --- a/model/entry_test.go +++ b/model/entry_test.go @@ -55,17 +55,3 @@ func TestValidateRange(t *testing.T) { t.Error(`A valid offset and limit should not generate any error`) } } - -func TestGetOppositeDirection(t *testing.T) { - if OppositeDirection("asc") != "desc" { - t.Errorf(`The opposite direction of "asc" should be "desc"`) - } - - if OppositeDirection("desc") != "asc" { - t.Errorf(`The opposite direction of "desc" should be "asc"`) - } - - if OppositeDirection("invalid") != "asc" { - t.Errorf(`An invalid direction should return "asc"`) - } -}