docs(context): fix some comments (#4396)

Signed-off-by: letreturn <letreturn@outlook.com>
This commit is contained in:
letreturn 2025-10-14 22:37:07 +08:00 committed by GitHub
parent c3d1092b3b
commit c221133ee8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -270,7 +270,7 @@ func (c *Context) Error(err error) *Error {
/************************************/ /************************************/
// Set is used to store a new key/value pair exclusively for this context. // Set is used to store a new key/value pair exclusively for this context.
// It also lazy initializes c.Keys if it was not used previously. // It also lazy initializes c.Keys if it was not used previously.
func (c *Context) Set(key any, value any) { func (c *Context) Set(key any, value any) {
c.mu.Lock() c.mu.Lock()
defer c.mu.Unlock() defer c.mu.Unlock()

View File

@ -39,7 +39,7 @@ func TestLogger(t *testing.T) {
// I wrote these first (extending the above) but then realized they are more // I wrote these first (extending the above) but then realized they are more
// like integration tests because they test the whole logging process rather // like integration tests because they test the whole logging process rather
// than individual functions. Im not sure where these should go. // than individual functions. I'm not sure where these should go.
buffer.Reset() buffer.Reset()
PerformRequest(router, http.MethodPost, "/example") PerformRequest(router, http.MethodPost, "/example")
assert.Contains(t, buffer.String(), "200") assert.Contains(t, buffer.String(), "200")
@ -103,7 +103,7 @@ func TestLoggerWithConfig(t *testing.T) {
// I wrote these first (extending the above) but then realized they are more // I wrote these first (extending the above) but then realized they are more
// like integration tests because they test the whole logging process rather // like integration tests because they test the whole logging process rather
// than individual functions. Im not sure where these should go. // than individual functions. I'm not sure where these should go.
buffer.Reset() buffer.Reset()
PerformRequest(router, http.MethodPost, "/example") PerformRequest(router, http.MethodPost, "/example")
assert.Contains(t, buffer.String(), "200") assert.Contains(t, buffer.String(), "200")