Base Project
This commit is contained in:
12
pkg/utils/async_handler.go
Normal file
12
pkg/utils/async_handler.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package utils
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
func AsyncHandler(fn func(c *gin.Context) error) gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
if err := fn(c); err != nil {
|
||||
c.Error(err)
|
||||
c.Next()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user