-
Notifications
You must be signed in to change notification settings - Fork 90
Description
go version go1.14.4 linux/amd64
programe:
package main
import (
"fmt"
"github.com/iris-contrib/middleware/cors"
"log"
"net"
"os"
)
func main() {
fmt.Println("Hello World!")
fmt.Println(os.Getuid())
f, err := os.Open("test.json")
if err != nil {
fmt.Printf("%s\n", err)
}
crs := cors.New(cors.Options{
AllowedOrigins: []string{"*"}, // allows everything, use that to change the hosts.
AllowCredentials: true,
})
}
error :
$ go build hello.go
github.com/iris-contrib/middleware/cors
gowork/src/github.com/iris-contrib/middleware/cors/cors.go:144:10: cannot use c.Serve (type func("github.com/kataras/iris/context".Context)) as type "github.com/kataras/iris/context".Handler in return argument
otherwise:
in go.mod:
there is a conflict between
github.com/iris-contrib/middleware v12.1.2+incompatible and import github.com/iris-contrib/middleware/cors