Closed ishehata closed 8 years ago
i am trying to use the cors middleware on the latest gin version
./main.go:17: cannot use cors.New(config) (type "gopkg.in/gin-gonic/gin.v1".HandlerFunc) as type "github.com/gin-gonic/gin".HandlerFunc in argument to r.Use
where
r := gin.New() config := cors.DefaultConfig() config.AllowOrigins = []string{"http://google.com"} r.Use(cors.New(config)) r.POST("/api/auth", api.Login) r.Run()
Operating System: Mac OS X
@eslammostafa please fix your import at the beginning of main.go
main.go
use:
import "gopkg.in/gin-gonic/gin.v1"
i am trying to use the cors middleware on the latest gin version
where
Operating System: Mac OS X