Skip to content

Commit

Permalink
fix: use any instead of interface{}
Browse files Browse the repository at this point in the history
  • Loading branch information
mojixcoder committed Oct 10, 2024
1 parent a4e0c71 commit bab9b2d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions h3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1074,14 +1074,14 @@ func assertNoErr(t *testing.T, err error) {
}
}

func assertEqual[T comparable](t *testing.T, expected, actual T, msgAndArgs ...interface{}) {
func assertEqual[T comparable](t *testing.T, expected, actual T, msgAndArgs ...any) {
t.Helper()

if expected != actual {
var (
expStr, actStr string

e, a interface{} = expected, actual
e, a any = expected, actual
)

switch e.(type) {
Expand All @@ -1098,7 +1098,7 @@ func assertEqual[T comparable](t *testing.T, expected, actual T, msgAndArgs ...i
}
}

func assertEqualEps(t *testing.T, expected, actual float64, msgAndArgs ...interface{}) {
func assertEqualEps(t *testing.T, expected, actual float64, msgAndArgs ...any) {
t.Helper()

if !equalEps(expected, actual) {
Expand All @@ -1113,7 +1113,7 @@ func assertEqualLatLng(t *testing.T, expected, actual LatLng) {
assertEqualEps(t, expected.Lng, actual.Lng, "longitude mismatch")
}

func assertEqualLatLngs(t *testing.T, expected, actual []LatLng, msgAndArgs ...interface{}) {
func assertEqualLatLngs(t *testing.T, expected, actual []LatLng, msgAndArgs ...any) {
t.Helper()

if len(expected) != len(actual) {
Expand Down Expand Up @@ -1146,7 +1146,7 @@ func assertEqualLatLngs(t *testing.T, expected, actual []LatLng, msgAndArgs ...i
}
}

func assertEqualCells(t *testing.T, expected, actual []Cell, msgAndArgs ...interface{}) {
func assertEqualCells(t *testing.T, expected, actual []Cell, msgAndArgs ...any) {
t.Helper()

if len(expected) != len(actual) {
Expand Down Expand Up @@ -1301,7 +1301,7 @@ func sortCells(s []Cell) []Cell {
return s
}

func logMsgAndArgs(t *testing.T, msgAndArgs ...interface{}) {
func logMsgAndArgs(t *testing.T, msgAndArgs ...any) {
t.Helper()

if len(msgAndArgs) > 0 {
Expand Down

0 comments on commit bab9b2d

Please sign in to comment.