Skip to content

Commit

Permalink
Merge pull request #42 from pellared/refactor-new-method
Browse files Browse the repository at this point in the history
Refactor New methods to use T interface
  • Loading branch information
matryer committed Sep 14, 2021
2 parents 338cee6 + dfad7c4 commit fb18f75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion is-1.7.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func callerName(skip int) string {
// the purpose of decorating log messages.
const maxStackLen = 50

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

func (is *I) callerinfo() (path string, line int, ok bool) {
var pc [maxStackLen]uintptr
Expand Down
5 changes: 2 additions & 3 deletions is.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import (
"path/filepath"
"reflect"
"strings"
"testing"
)

// T reports when failures occur.
Expand Down Expand Up @@ -171,7 +170,7 @@ func (is *I) Equal(a, b interface{}) {
// // TODO: test
// })
// }
func (is *I) New(t *testing.T) *I {
func (is *I) New(t T) *I {
return New(t)
}

Expand All @@ -186,7 +185,7 @@ func (is *I) New(t *testing.T) *I {
// // TODO: test
// })
// }
func (is *I) NewRelaxed(t *testing.T) *I {
func (is *I) NewRelaxed(t T) *I {
return NewRelaxed(t)
}

Expand Down

0 comments on commit fb18f75

Please sign in to comment.