From f46d372b11860baee6cb6221e0281a706e0f6001 Mon Sep 17 00:00:00 2001 From: tobg <71645695+tobg8@users.noreply.github.com> Date: Sat, 2 Nov 2024 02:13:53 +0100 Subject: [PATCH] refacto: switch case (#9) --- src/usecases/repository.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/usecases/repository.go b/src/usecases/repository.go index 4cfc5ce..bb3edcb 100644 --- a/src/usecases/repository.go +++ b/src/usecases/repository.go @@ -146,13 +146,9 @@ func validateDateOperator(qualifier, value string) error { func extractValue(value string) string { var extractedValue string switch { - case strings.HasPrefix(value, ">="): + case strings.HasPrefix(value, ">=") || strings.HasPrefix(value, "<="): extractedValue = value[2:] - case strings.HasPrefix(value, "<="): - extractedValue = value[2:] - case strings.HasPrefix(value, ">"): - extractedValue = value[1:] - case strings.HasPrefix(value, "<"): + case strings.HasPrefix(value, ">") || strings.HasPrefix(value, "<"): extractedValue = value[1:] default: extractedValue = value