Skip to content

Commit 3a156ba

Browse files
committed
chore: rename internal math package to mathutils
This is done to reduce chances of conflict
1 parent c42bb3b commit 3a156ba

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

2024/01/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"slices"
88

99
"github.com/agrmohit/aoc/internal/inputs"
10-
mathinternal "github.com/agrmohit/aoc/internal/math"
10+
"github.com/agrmohit/aoc/internal/mathutils"
1111
)
1212

1313
//go:embed input.txt
@@ -25,7 +25,7 @@ func solvePart1(input string) int {
2525
totalDistance := 0
2626

2727
for i := range left {
28-
totalDistance += mathinternal.Abs(left[i] - right[i])
28+
totalDistance += mathutils.Abs(left[i] - right[i])
2929
}
3030

3131
return totalDistance

2024/02/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"slices"
77

88
"github.com/agrmohit/aoc/internal/inputs"
9-
mathinternal "github.com/agrmohit/aoc/internal/math"
9+
"github.com/agrmohit/aoc/internal/mathutils"
1010
)
1111

1212
//go:embed input.txt
@@ -28,7 +28,7 @@ func checkIsSafe(row []int) bool {
2828
}
2929

3030
// If absolute difference between consecutive numbers is not 1, 2 or 3
31-
if mathinternal.Abs(row[i]-row[i-1]) > 3 {
31+
if mathutils.Abs(row[i]-row[i-1]) > 3 {
3232
return false
3333
}
3434
}

internal/math/math.go renamed to internal/mathutils/mathutils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Package math contains commonly used mathematical functions
2-
package math
1+
// Package mathutils contains commonly used mathematical functions
2+
package mathutils
33

44
// Abs takes an int and returns the absolute value
55
func Abs(num int) int {

internal/math/math_test.go renamed to internal/mathutils/mathutils_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package math
1+
package mathutils
22

33
import "testing"
44

0 commit comments

Comments
 (0)