Skip to content

pkg/test/context.go: make NewTestCtx return ptr #451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/test/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type TestCtx struct {

type finalizerFn func() error

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

id := prefix + "-" + strconv.FormatInt(time.Now().Unix(), 10)
return TestCtx{
return &TestCtx{
ID: id,
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/test-framework/memcached_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func TestMemcached(t *testing.T) {
})
}

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