Skip to content

Commit fb18f75

Browse files
authored
Merge pull request #42 from pellared/refactor-new-method
Refactor New methods to use T interface
2 parents 338cee6 + dfad7c4 commit fb18f75

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

is-1.7.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func callerName(skip int) string {
3333
// the purpose of decorating log messages.
3434
const maxStackLen = 50
3535

36-
var reIsSourceFile = regexp.MustCompile("is(-1.7)?\\.go$")
36+
var reIsSourceFile = regexp.MustCompile(`is(-1.7)?\.go$`)
3737

3838
func (is *I) callerinfo() (path string, line int, ok bool) {
3939
var pc [maxStackLen]uintptr

is.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import (
4646
"path/filepath"
4747
"reflect"
4848
"strings"
49-
"testing"
5049
)
5150

5251
// T reports when failures occur.
@@ -171,7 +170,7 @@ func (is *I) Equal(a, b interface{}) {
171170
// // TODO: test
172171
// })
173172
// }
174-
func (is *I) New(t *testing.T) *I {
173+
func (is *I) New(t T) *I {
175174
return New(t)
176175
}
177176

@@ -186,7 +185,7 @@ func (is *I) New(t *testing.T) *I {
186185
// // TODO: test
187186
// })
188187
// }
189-
func (is *I) NewRelaxed(t *testing.T) *I {
188+
func (is *I) NewRelaxed(t T) *I {
190189
return NewRelaxed(t)
191190
}
192191

0 commit comments

Comments
 (0)