fix(bots): fix gatherer Go compile error - declare nearestEnergy in function scope

The nearestEnergy variable was referenced inside findNearestEnergy() but
only declared in the caller's scope. Declare it locally and use _ in caller.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jedarden 2026-04-24 07:33:28 -04:00
parent 8bcfdf57b3
commit 6899b2efa0

View file

@ -84,7 +84,7 @@ func (s *GathererStrategy) computeBotMove(
}
// Try to find nearest untargeted energy
nearestEnergy, path := s.findNearestEnergy(bot.Position, energyPositions, usedEnergy, enemyPositions, config)
_, path := s.findNearestEnergy(bot.Position, energyPositions, usedEnergy, enemyPositions, config)
if path != nil && len(path) > 0 {
// Move towards the energy
return &Move{
@ -156,7 +156,7 @@ func (s *GathererStrategy) findNearestEnergy(
queue := list.New()
queue.PushBack(queueItem{pos: start, path: []Direction{}})
_ = nearestEnergy // Track found position (unused but semantically meaningful)
var nearestEnergy Position
var bestPath []Direction
for queue.Len() > 0 {