refactor(context): replace fmt.Errorf with fmt.Sprintf in panic message

This commit is contained in:
flc1125 2025-05-23 15:14:08 +08:00
parent a94d7e7cd8
commit b00f47329d

View File

@ -289,7 +289,7 @@ func (c *Context) MustGet(key any) any {
if value, exists := c.Get(key); exists { if value, exists := c.Get(key); exists {
return value return value
} }
panic(fmt.Errorf("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) { func getTyped[T any](c *Context, key any) (res T) {