mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-14 12:12:12 +08:00
refactor(context): replace fmt.Errorf with fmt.Sprintf in panic message
This commit is contained in:
parent
a94d7e7cd8
commit
b00f47329d
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user