yaegi
yaegi copied to clipboard
Import the redigo package in traefik plugins prompts an error
The following program sample.go triggers an unexpected result
package main
import (
"github.com/gomodule/redigo/redis"
)
Expected result
Can start traefik normally
Got
2022/02/16 17:16:57 traefik.go:79: command traefik error: infra/traefik-plugins/ratelimiter: failed to import plugin code "infra/traefik-plugins/ratelimiter": 1:21: import "infra/traefik-plugins/ratelimiter" error: plugins-local/src/infra/traefik-plugins/ratelimiter/leakybucket.go:5:2: import "github.com/gomodule/redigo/redis" error: plugins-local/src/infra/traefik-plugins/ratelimiter/vendor/github.com/gomodule/redigo/redis/conn.go:236:20: cannot use type func(*net.Dialer, context.Context, string, string) (net.Conn, error) as type func(context.Context,string,string) (net.Conn,error) in assignment
Yaegi Version
github.com/traefik/yaegi v0.11.2
Additional Notes
vim plugins-local/src/infra/traefik-plugins/ratelimiter/leakybucket.go
import "github.com/gomodule/redigo/redis"
experimental:
rateLimit:
moduleName: infra/traefik-plugins/ratelimiter
@kk-kwok @mvertes any workaround for this? facing the same problem
i have same problem
Same problem here