From eeadf58d37353208cd2b989510d510241024d5b4 Mon Sep 17 00:00:00 2001 From: Pierre Durand Date: Fri, 2 Aug 2024 02:06:06 +0200 Subject: [PATCH] copy common files (update golangci-lint to v1.59.1) --- .golangci.yml | 1 - Makefile-common.mk | 2 +- langton.go | 14 +++++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index e8f807a..8b30f15 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -24,7 +24,6 @@ linters: - "errchkjson" - "errname" - "errorlint" - - "execinquery" - "exhaustive" # - "exhaustivestruct " # Replaced by exhaustruct. # - "exhaustruct" # Too many false positive, and not always relevant. diff --git a/Makefile-common.mk b/Makefile-common.mk index 11ae187..98d11a2 100644 --- a/Makefile-common.mk +++ b/Makefile-common.mk @@ -53,7 +53,7 @@ lint: # - tag: vX.Y.Z # - branch: master # - latest -GOLANGCI_LINT_VERSION?=v1.56.2 +GOLANGCI_LINT_VERSION?=v1.59.1 # Installation type: # - binary # - source diff --git a/langton.go b/langton.go index 4fef96c..ea49f28 100644 --- a/langton.go +++ b/langton.go @@ -172,18 +172,18 @@ func (g *Game) Step() { } } -func normalize(v, max int) int { +func normalize(v, maxValue int) int { if v < 0 { - v = v%max + max + v = v%maxValue + maxValue } - if v >= max { - v %= max + if v >= maxValue { + v %= maxValue } return v } -func normalizePoint(v, max Point) Point { - v.X = normalize(v.X, max.X) - v.Y = normalize(v.Y, max.Y) +func normalizePoint(v, maxPoint Point) Point { + v.X = normalize(v.X, maxPoint.X) + v.Y = normalize(v.Y, maxPoint.Y) return v }