We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
├── _fninterface │ └── src │ └── github.com │ └── foo │ └── bar │ └── bar.go └ my_test.go
package sample import ( "fmt" "path/filepath" "reflect" "testing" "github.com/containous/dyngo/interp" "github.com/containous/dyngo/stdlib" ) type Huu struct { name string } func (h *Huu) Hello() { fmt.Println("Hello", h.name) } func TestInterfaceIn(t *testing.T) { goPath, err := filepath.Abs("./_fninterface/") if err != nil { t.Fatal(err) } // Init go interpreter i := interp.New(interp.Opt{ GoPath: goPath, }) i.Use(stdlib.Value, stdlib.Type) // Use binary standard library if _, err := i.Eval(`import "github.com/foo/bar"`); err != nil { t.Fatal(err) } // Bar fnCall, err := i.Eval(`bar.Call()`) if err != nil { t.Fatal(err) } fnCall.Call([]reflect.Value{reflect.ValueOf(&Huu{name: "test"})}) }
package bar import ( "fmt" ) type Foo interface { Hello() } func Call() func(Foo) { return func(foo Foo) { fmt.Println("in") foo.Hello() } }
Got:
fninterface_test.go:34: _fninterface/src/github.com/foo/bar/bar.go:14:3: undefined selector: Hello
The text was updated successfully, but these errors were encountered:
@ldez, I propose to close this issue, obsolete now
Sorry, something went wrong.
No branches or pull requests
tree
my_test.go
bar.go
Got:
The text was updated successfully, but these errors were encountered: