From 309d0be8345daddd39c8bbb6f426468d63b762f4 Mon Sep 17 00:00:00 2001 From: flc1125 Date: Fri, 23 May 2025 15:37:16 +0800 Subject: [PATCH] refactor(context): improve error message for missing key in context - Remove unnecessary quotes around the key in the error message - Simplify the error message format for better readability --- context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/context.go b/context.go index b8d3dc34..0ef90efd 100644 --- a/context.go +++ b/context.go @@ -289,7 +289,7 @@ func (c *Context) MustGet(key any) any { if value, exists := c.Get(key); exists { return value } - panic(fmt.Sprintf("key \"%v\" does not exist", key)) + panic(fmt.Sprintf("key %v does not exist", key)) } func getTyped[T any](c *Context, key any) (res T) {