diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2024-12-28 11:38:44 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-01-27 16:43:59 +0100 |
| commit | 2ee42003433b2faeda4ded1bc6557a6eaf3720ff (patch) | |
| tree | ec619361d443732c375fea62853c6a6cb4c4d058 /go/game/map.go | |
| parent | 00c718e7c7dd082da6aff619147c156c721861b7 (diff) | |
| download | muhqs-game-2ee42003433b2faeda4ded1bc6557a6eaf3720ff.tar.gz muhqs-game-2ee42003433b2faeda4ded1bc6557a6eaf3720ff.zip | |
improve code
* explicitly ignore errors where appropriate
* do not append in a loop
* specify format string in Errorf
Diffstat (limited to 'go/game/map.go')
| -rw-r--r-- | go/game/map.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/go/game/map.go b/go/game/map.go index e0c99911..fb67ebbb 100644 --- a/go/game/map.go +++ b/go/game/map.go @@ -226,7 +226,7 @@ func (m *Map) RandomTileFromSymbols(r *rand.Rand, symbols []string) (Position, e for _, symbol := range symbols { tileString, ok := m.symbols[symbol] if !ok { - return INVALID_POSITION(), fmt.Errorf(fmt.Sprintf("symbol %s not in the map symbols %v", symbol, m.symbols)) + return INVALID_POSITION(), fmt.Errorf("%s", fmt.Sprintf("symbol %s not in the map symbols %v", symbol, m.symbols)) } tileType, ok := TileNames[tileString] |
