From 4faf16c84b09f25f38bdfff74e1740bb848217c2 Mon Sep 17 00:00:00 2001 From: Kharec Date: Thu, 13 Nov 2025 08:02:52 +0100 Subject: [PATCH] refactor: use switch on vote.Type --- internal/integration/repositories_integration_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/integration/repositories_integration_test.go b/internal/integration/repositories_integration_test.go index c71d8d6..7e93070 100644 --- a/internal/integration/repositories_integration_test.go +++ b/internal/integration/repositories_integration_test.go @@ -4,9 +4,10 @@ import ( "fmt" "testing" - "golang.org/x/crypto/bcrypt" "goyco/internal/database" "goyco/internal/repositories" + + "golang.org/x/crypto/bcrypt" ) func TestIntegration_Repositories(t *testing.T) { @@ -320,9 +321,10 @@ func TestIntegration_Repositories(t *testing.T) { var upVotes, downVotes int64 for _, vote := range votes { - if vote.Type == database.VoteUp { + switch vote.Type { + case database.VoteUp: upVotes++ - } else if vote.Type == database.VoteDown { + case database.VoteDown: downVotes++ } }