瀏覽代碼

Remove unused function

Frédéric Guillot 5 年之前
父節點
當前提交
b35fece3d5
共有 2 個文件被更改,包括 0 次插入23 次删除
  1. 0 9
      model/entry.go
  2. 0 14
      model/entry_test.go

+ 0 - 9
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"
-}

+ 0 - 14
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"`)
-	}
-}