From 85fabe7c5c31a77205c7077fe35c301027e75f88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Mengu=C3=A9?= Date: Sun, 3 Mar 2024 18:29:24 +0100 Subject: [PATCH] assert: make tHelper a type alias The tHelper interface is defined only for internal usage. We don't need a "hard" type for it as we don't define methods on it. Let's make is just a alias to the anonymous interface it represents. Note: we are already using type aliases elswhere, and type aliases were introduced a long time ago in Go 1.9. --- assert/assertions.go | 2 +- require/requirements.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assert/assertions.go b/assert/assertions.go index 0b7570f..75eb2cd 100644 --- a/assert/assertions.go +++ b/assert/assertions.go @@ -1872,7 +1872,7 @@ var spewConfigStringerEnabled = spew.ConfigState{ MaxDepth: 10, } -type tHelper interface { +type tHelper = interface { Helper() } diff --git a/require/requirements.go b/require/requirements.go index 91772df..6b7ce92 100644 --- a/require/requirements.go +++ b/require/requirements.go @@ -6,7 +6,7 @@ type TestingT interface { FailNow() } -type tHelper interface { +type tHelper = interface { Helper() }