Skip to content

Commit

Permalink
copy common files (update golangci-lint to v1.59.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrre committed Aug 2, 2024
1 parent ddae150 commit eeadf58
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ linters:
- "errchkjson"
- "errname"
- "errorlint"
- "execinquery"
- "exhaustive"
# - "exhaustivestruct " # Replaced by exhaustruct.
# - "exhaustruct" # Too many false positive, and not always relevant.
Expand Down
2 changes: 1 addition & 1 deletion Makefile-common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions langton.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit eeadf58

Please sign in to comment.