From b35fece3d5ced9a67c4e082f1edfbaf3ebe3408f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Sun, 3 Jan 2021 22:59:05 -0800 Subject: [PATCH] Remove unused function --- model/entry.go | 9 --------- model/entry_test.go | 14 -------------- 2 files changed, 23 deletions(-) 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"`) - } -}