Repository: stretchr/testify
Pull request #1409 (2023-07-05 13:28:50)

CI: tests from go1.17
## Summary
Test old Go versions all the way back to 1.17.

## Changes
<!-- * Description of change 1 -->
<!-- * Description of change 2 -->
<!-- ... -->

## Motivation
<!-- Why were the changes necessary. -->

<!-- ## Example usage (if applicable) -->

## Related issues
<!-- Put `Closes #XXXX` for each issue number this PR fixes/closes -->


SuperQ: @dolmen Due to use of `reflect`, the minimum Go version is already 1.17.
dolmen: @SuperQ 
> @dolmen Due to use of reflect, the minimum Go version is already 1.17.

What new features of `reflect` from go1.17 have you seen used here?
SuperQ: When I was doing my testing [this error happens in 1.16 and older](https://github.com/stretchr/testify/actions/runs/5464887276/jobs/9947538517).

```
Run go test -v -race ./...
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading github.com/stretchr/objx v0.5.0
go: downloading gopkg.in/yaml.v3 v3.0.1
# github.com/stretchr/testify/assert
Error: assert/assertions.go:9[4](https://github.com/stretchr/testify/actions/runs/5464887276/jobs/9947538517#step:4:5):23: field.IsExported undefined (type reflect.StructField has no field or method IsExported)
# github.com/stretchr/testify/assert [github.com/stretchr/testify/assert.test]
Error: assert/assertions.go:[9](https://github.com/stretchr/testify/actions/runs/5464887276/jobs/9947538517#step:4:10)4:23: field.IsExported undefined (type reflect.StructField has no field or method IsExported)
FAIL	github.com/stretchr/testify [build failed]
FAIL	github.com/stretchr/testify/assert [build failed]
FAIL	github.com/stretchr/testify/mock [build failed]
FAIL	github.com/stretchr/testify/require [build failed]
FAIL	github.com/stretchr/testify/suite [build failed]
Error: Process completed with exit code 2.
```
dolmen: @SuperQ Good to know. Thank you.
SuperQ: Weird that the tests seem flakey with setup-go v4.
SuperQ: Should I revert setup-go to v3.2.0 for now?
dolmen: Yes, let's stay on v3.2.0 for now.

Patch:
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 08e548c..0ffd24c 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -6,7 +6,9 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        go_version: ["1.20", "1.19"]
+        go_version:
+          - "1.19"
+          - "1.20"
     steps:
       - uses: actions/checkout@v3
       - name: Setup Go
@@ -17,3 +19,19 @@ jobs:
       - run: ./.ci.gofmt.sh
       - run: ./.ci.govet.sh
       - run: go test -v -race ./...
+  test:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        go_version:
+          - "1.17"
+          - "1.18"
+          - "1.19"
+          - "1.20"
+    steps:
+      - uses: actions/checkout@v3
+      - name: Setup Go
+        uses: actions/setup-go@v3.2.0
+        with:
+          go-version: ${{ matrix.go_version }}
+      - run: go test -v -race ./...
diff --git a/assert/assertion_format.go b/assert/assertion_format.go
index 0cb248c..84dbd6c 100644
--- a/assert/assertion_format.go
+++ b/assert/assertion_format.go
@@ -107,7 +107,7 @@ func EqualExportedValuesf(t TestingT, expected interface{}, actual interface{},
 	return EqualExportedValues(t, expected, actual, append([]interface{}{msg}, args...)...)
 }
 
-// EqualValuesf asserts that two objects are equal or convertible to the same types
+// EqualValuesf asserts that two objects are equal or convertable to the same types
 // and equal.
 //
 //	assert.EqualValuesf(t, uint32(123), int32(123), "error message %s", "formatted")
diff --git a/assert/assertion_forward.go b/assert/assertion_forward.go
index c954153..b1d94ae 100644
--- a/assert/assertion_forward.go
+++ b/assert/assertion_forward.go
@@ -189,7 +189,7 @@ func (a *Assertions) EqualExportedValuesf(expected interface{}, actual interface
 	return EqualExportedValuesf(a.t, expected, actual, msg, args...)
 }
 
-// EqualValues asserts that two objects are equal or convertible to the same types
+// EqualValues asserts that two objects are equal or convertable to the same types
 // and equal.
 //
 //	a.EqualValues(uint32(123), int32(123))
@@ -200,7 +200,7 @@ func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAn
 	return EqualValues(a.t, expected, actual, msgAndArgs...)
 }
 
-// EqualValuesf asserts that two objects are equal or convertible to the same types
+// EqualValuesf asserts that two objects are equal or convertable to the same types
 // and equal.
 //
 //	a.EqualValuesf(uint32(123), int32(123), "error message %s", "formatted")
diff --git a/assert/assertions.go b/assert/assertions.go
index 6ab0ec3..b1e5d3e 100644
--- a/assert/assertions.go
+++ b/assert/assertions.go
@@ -523,7 +523,7 @@ func truncatingFormat(data interface{}) string {
 	return value
 }
 
-// EqualValues asserts that two objects are equal or convertible to the same types
+// EqualValues asserts that two objects are equal or convertable to the same types
 // and equal.
 //
 //	assert.EqualValues(t, uint32(123), int32(123))
diff --git a/go.mod b/go.mod
index 60d69a8..d3c4d72 100644
--- a/go.mod
+++ b/go.mod
@@ -2,7 +2,7 @@ module github.com/stretchr/testify
 
 // This should match the minimum supported version that is tested in
 // .github/workflows/main.yml
-go 1.19
+go 1.17
 
 require (
 	github.com/davecgh/go-spew v1.1.1
diff --git a/require/require.go b/require/require.go
index 4227bec..63f8521 100644
--- a/require/require.go
+++ b/require/require.go
@@ -235,7 +235,7 @@ func EqualExportedValuesf(t TestingT, expected interface{}, actual interface{},
 	t.FailNow()
 }
 
-// EqualValues asserts that two objects are equal or convertible to the same types
+// EqualValues asserts that two objects are equal or convertable to the same types
 // and equal.
 //
 //	assert.EqualValues(t, uint32(123), int32(123))
@@ -249,7 +249,7 @@ func EqualValues(t TestingT, expected interface{}, actual interface{}, msgAndArg
 	t.FailNow()
 }
 
-// EqualValuesf asserts that two objects are equal or convertible to the same types
+// EqualValuesf asserts that two objects are equal or convertable to the same types
 // and equal.
 //
 //	assert.EqualValuesf(t, uint32(123), int32(123), "error message %s", "formatted")
diff --git a/require/require_forward.go b/require/require_forward.go
index f512d63..3b5b093 100644
--- a/require/require_forward.go
+++ b/require/require_forward.go
@@ -190,7 +190,7 @@ func (a *Assertions) EqualExportedValuesf(expected interface{}, actual interface
 	EqualExportedValuesf(a.t, expected, actual, msg, args...)
 }
 
-// EqualValues asserts that two objects are equal or convertible to the same types
+// EqualValues asserts that two objects are equal or convertable to the same types
 // and equal.
 //
 //	a.EqualValues(uint32(123), int32(123))
@@ -201,7 +201,7 @@ func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAn
 	EqualValues(a.t, expected, actual, msgAndArgs...)
 }
 
-// EqualValuesf asserts that two objects are equal or convertible to the same types
+// EqualValuesf asserts that two objects are equal or convertable to the same types
 // and equal.
 //
 //	a.EqualValuesf(uint32(123), int32(123), "error message %s", "formatted")


Test patch:
diff --git a/assert/assertions_test.go b/assert/assertions_test.go
index 162c718..acd4e59 100644
--- a/assert/assertions_test.go
+++ b/assert/assertions_test.go
@@ -1428,7 +1428,7 @@ func TestError(t *testing.T) {
 	True(t, Error(mockT, err), "Error with error should return True")
 
 	// go vet check
-	True(t, Errorf(mockT, err, "example with %s", "formatted message"), "Errorf with error should return True")
+	True(t, Errorf(mockT, err, "example with %s", "formatted message"), "Errorf with error should rturn True")
 
 	// returning an empty error interface
 	err = func() error {
@@ -1907,12 +1907,12 @@ func TestInEpsilonSlice(t *testing.T) {
 	True(t, InEpsilonSlice(mockT,
 		[]float64{2.2, math.NaN(), 2.0},
 		[]float64{2.1, math.NaN(), 2.1},
-		0.06), "{2.2, NaN, 2.0} is element-wise close to {2.1, NaN, 2.1} in epsilon=0.06")
+		0.06), "{2.2, NaN, 2.0} is element-wise close to {2.1, NaN, 2.1} in espilon=0.06")
 
 	False(t, InEpsilonSlice(mockT,
 		[]float64{2.2, 2.0},
 		[]float64{2.1, 2.1},
-		0.04), "{2.2, 2.0} is not element-wise close to {2.1, 2.1} in epsilon=0.04")
+		0.04), "{2.2, 2.0} is not element-wise close to {2.1, 2.1} in espilon=0.04")
 
 	False(t, InEpsilonSlice(mockT, "", nil, 1), "Expected non numeral slices to fail")
 }
diff --git a/mock/mock_test.go b/mock/mock_test.go
index 77493c5..9ceebbc 100644
--- a/mock/mock_test.go
+++ b/mock/mock_test.go
@@ -1962,7 +1962,7 @@ func TestAfterTotalWaitTimeWhileExecution(t *testing.T) {
 
 	end := time.Now()
 	elapsedTime := end.Sub(start)
-	assert.True(t, elapsedTime > waitMs, fmt.Sprintf("Total elapsed time:%v should be at least greater than %v", elapsedTime, waitMs))
+	assert.True(t, elapsedTime > waitMs, fmt.Sprintf("Total elapsed time:%v should be atleast greater than %v", elapsedTime, waitMs))
 	assert.Equal(t, total, len(results))
 	for i := range results {
 		assert.Equal(t, fmt.Sprintf("Time%d", i), results[i], "Return value of method should be same")