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
This commit is contained in:
flc1125 2025-05-23 15:37:16 +08:00
parent 9c35f7958b
commit 309d0be834

View File

@ -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) {