Skip to content

Commit

Permalink
Don't export variable in test file
Browse files Browse the repository at this point in the history
  • Loading branch information
bradwest-wk committed Nov 13, 2020
1 parent cb8fedc commit 3bde698
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rest/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type ComplexTestResourceHandler struct {
BaseResourceHandler
}

type ContextKey string
type contextKey string

func (t ComplexTestResourceHandler) ResourceName() string {
return "resources"
Expand All @@ -77,7 +77,7 @@ func TestSetValueOnRequestContext(t *testing.T) {
req, err := http.NewRequestWithContext(context.Background(), "GET", "http://example.com/foo", nil)
require.NoError(t, err)

k := ContextKey("mykey")
k := contextKey("mykey")
val := req.Context().Value(k)
assert.Nil(t, val)

Expand All @@ -103,7 +103,7 @@ func TestValueReturnsPreviouslySetValue(t *testing.T) {
require.NoError(t, err)

ctx := NewContext(nil, req, nil)
k := ContextKey("mykey")
k := contextKey("mykey")
expected := "myval"
ctx = ctx.WithValue(k, expected)

Expand All @@ -117,7 +117,7 @@ func TestValueDefaultsToParentContext(t *testing.T) {
require.NoError(t, err)

ctx := NewContext(nil, req, nil).(*requestContext)
k := ContextKey("mykey")
k := contextKey("mykey")
expected := "myval"
ctx.Context = context.WithValue(ctx.Context, k, expected)

Expand Down

0 comments on commit 3bde698

Please sign in to comment.