Skip to content

Commit 7613216

Browse files
blgmonsi
authored andcommittedFeb 12, 2025·
chore: replace interface{} with any
- See discussion in: onsi/ginkgo#1203 - Updating Gomega for consistency with Ginkgo
1 parent 9fe5259 commit 7613216

File tree

106 files changed

+712
-704
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+712
-704
lines changed
 

‎docs/index.md

+59-59
Large diffs are not rendered by default.

‎format/format.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ If the CustomFormatter does not want to handle the object it should return ("",
7373
7474
Strings returned by CustomFormatters are not truncated
7575
*/
76-
type CustomFormatter func(value interface{}) (string, bool)
76+
type CustomFormatter func(value any) (string, bool)
7777
type CustomFormatterKey uint
7878

7979
var customFormatterKey CustomFormatterKey = 1
@@ -125,7 +125,7 @@ If expected is omitted, then the message looks like:
125125
<pretty printed actual>
126126
<message>
127127
*/
128-
func Message(actual interface{}, message string, expected ...interface{}) string {
128+
func Message(actual any, message string, expected ...any) string {
129129
if len(expected) == 0 {
130130
return fmt.Sprintf("Expected\n%s\n%s", Object(actual, 1), message)
131131
}
@@ -255,7 +255,7 @@ recursing into the object.
255255
256256
Set PrintContextObjects to true to print the content of objects implementing context.Context
257257
*/
258-
func Object(object interface{}, indentation uint) string {
258+
func Object(object any, indentation uint) string {
259259
indent := strings.Repeat(Indent, int(indentation))
260260
value := reflect.ValueOf(object)
261261
commonRepresentation := ""
@@ -392,7 +392,7 @@ func formatValue(value reflect.Value, indentation uint) string {
392392
}
393393
}
394394

395-
func formatString(object interface{}, indentation uint) string {
395+
func formatString(object any, indentation uint) string {
396396
if indentation == 1 {
397397
s := fmt.Sprintf("%s", object)
398398
components := strings.Split(s, "\n")

0 commit comments

Comments
 (0)
Please sign in to comment.