yaegi icon indicating copy to clipboard operation
yaegi copied to clipboard

Import the redigo package in traefik plugins prompts an error

Open kk-kwok opened this issue 3 years ago • 14 comments

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 avatar Feb 16 '22 11:02 kk-kwok

@kk-kwok @mvertes any workaround for this? facing the same problem

prajithp13 avatar Apr 23 '22 04:04 prajithp13

i have same problem

luoxinliu avatar Aug 19 '22 08:08 luoxinliu

Same problem here

VladyslavLukyanenko avatar Oct 22 '22 10:10 VladyslavLukyanenko