From 961f4951f43e8874409208f84e1d9dfd530fc96c Mon Sep 17 00:00:00 2001 From: Niko Filippidis <11477309+filikos@users.noreply.github.com> Date: Wed, 1 Sep 2021 13:35:13 +0200 Subject: [PATCH] Adjusted naming and formatting --- context.go | 8 ++++---- context_test.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/context.go b/context.go index 44ebd3ab..9a146f4e 100644 --- a/context.go +++ b/context.go @@ -383,13 +383,13 @@ func (c *Context) Param(key string) string { return c.Params.ByName(key) } -// SetParam adds param to context an +// AddParam adds param to context an // replaces path param key with given value for e2e testing purposes // Example Route: "/user/:id" -// SetParam("id", 1) +// AddParam("id", 1) // Result: "/user/1" -func (c *Context) SetParam(key, value string) { - c.Params = append(c.Params, Param{Key: key,Value: value}) +func (c *Context) AddParam(key, value string) { + c.Params = append(c.Params, Param{Key: key, Value: value}) } // Query returns the keyed url query value if it exists, diff --git a/context_test.go b/context_test.go index 85e14a2b..45fba4fb 100644 --- a/context_test.go +++ b/context_test.go @@ -2151,11 +2151,11 @@ func TestContextWithFallbackValueFromRequestContext(t *testing.T) { } } -func TestContextSetParam(t *testing.T) { +func TestContextAddParam(t *testing.T) { c := &Context{} id := "id" value := "1" - c.SetParam(id, value) + c.AddParam(id, value) v, ok := c.Params.Get(id) assert.Equal(t, ok, true)