Skip to content

Commit 408e756

Browse files
authored
pkg/test/context.go: make NewTestCtx return ptr (#451)
1 parent c30b06b commit 408e756

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/test/context.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type TestCtx struct {
3030

3131
type finalizerFn func() error
3232

33-
func NewTestCtx(t *testing.T) TestCtx {
33+
func NewTestCtx(t *testing.T) *TestCtx {
3434
var prefix string
3535
if t != nil {
3636
// TestCtx is used among others for namespace names where '/' is forbidden
@@ -48,7 +48,7 @@ func NewTestCtx(t *testing.T) TestCtx {
4848
}
4949

5050
id := prefix + "-" + strconv.FormatInt(time.Now().Unix(), 10)
51-
return TestCtx{
51+
return &TestCtx{
5252
ID: id,
5353
}
5454
}

test/test-framework/memcached_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func TestMemcached(t *testing.T) {
5151
})
5252
}
5353

54-
func memcachedScaleTest(t *testing.T, f *framework.Framework, ctx framework.TestCtx) error {
54+
func memcachedScaleTest(t *testing.T, f *framework.Framework, ctx *framework.TestCtx) error {
5555
namespace, err := ctx.GetNamespace()
5656
if err != nil {
5757
return fmt.Errorf("could not get namespace: %v", err)

0 commit comments

Comments
 (0)