From 2ee42003433b2faeda4ded1bc6557a6eaf3720ff Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 28 Dec 2024 11:38:44 +0100 Subject: improve code * explicitly ignore errors where appropriate * do not append in a loop * specify format string in Errorf --- go/game/attack.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'go/game/attack.go') diff --git a/go/game/attack.go b/go/game/attack.go index 08bc9567..3896e142 100644 --- a/go/game/attack.go +++ b/go/game/attack.go @@ -12,7 +12,7 @@ type Attack struct { } func INVALID_ATTACK(a Attack) bool { - return a.attacks == nil || len(a.attacks) == 0 + return len(a.attacks) == 0 } func (a Attack) MaxRange() int { -- cgit v1.2.3