refactor: use switch on vote.Type

This commit is contained in:
2025-11-13 08:02:52 +01:00
parent 028bde4737
commit 4faf16c84b

View File

@@ -4,9 +4,10 @@ import (
"fmt" "fmt"
"testing" "testing"
"golang.org/x/crypto/bcrypt"
"goyco/internal/database" "goyco/internal/database"
"goyco/internal/repositories" "goyco/internal/repositories"
"golang.org/x/crypto/bcrypt"
) )
func TestIntegration_Repositories(t *testing.T) { func TestIntegration_Repositories(t *testing.T) {
@@ -320,9 +321,10 @@ func TestIntegration_Repositories(t *testing.T) {
var upVotes, downVotes int64 var upVotes, downVotes int64
for _, vote := range votes { for _, vote := range votes {
if vote.Type == database.VoteUp { switch vote.Type {
case database.VoteUp:
upVotes++ upVotes++
} else if vote.Type == database.VoteDown { case database.VoteDown:
downVotes++ downVotes++
} }
} }