Skip to content

Commit

Permalink
assert: make tHelper a type alias
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dolmen committed Mar 3, 2024
1 parent bb548d0 commit 85fabe7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assert/assertions.go
Expand Up @@ -1872,7 +1872,7 @@ var spewConfigStringerEnabled = spew.ConfigState{
MaxDepth: 10,
}

type tHelper interface {
type tHelper = interface {
Helper()
}

Expand Down
2 changes: 1 addition & 1 deletion require/requirements.go
Expand Up @@ -6,7 +6,7 @@ type TestingT interface {
FailNow()
}

type tHelper interface {
type tHelper = interface {
Helper()
}

Expand Down

0 comments on commit 85fabe7

Please sign in to comment.