package xip import ( "context" "github.com/gin-gonic/gin" ) func GetIpFromContext(ctx context.Context) string { if v, ok := ctx.(*gin.Context); ok { return v.ClientIP() } return "" }