Skip to content
New issue

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

EvalPath not working with a directory #1676

Open
SolarLune opened this issue Jan 6, 2025 · 0 comments
Open

EvalPath not working with a directory #1676

SolarLune opened this issue Jan 6, 2025 · 0 comments

Comments

@SolarLune
Copy link

SolarLune commented Jan 6, 2025

The following program sample.go triggers an unexpected result

N/A

Expected result

N/A

Got

N/A

Yaegi Version

devel

Additional Notes

Not sure if I'm misunderstanding, but I can't seem to get Interpreter.EvalPath() to evaluate a directory, while it does work for a single file?

newInter := interp.New(interp.Options{})

if err := newInter.Use(stdlib.Symbols); err != nil {
	panic(err)
}

fmt.Println(newInter.EvalPath("assets/components/setup.go")) // Works
fmt.Println(newInter.EvalPath("assets/components")) // Doesn't

This issue implies it's possible: #882

But even though I feel like I've tried every combination of setting the Option struct's GoPath and FileSystem fields and using relative and absolute file paths, it simply does not pick up the directory with my files in it.

Any ideas? How is it supposed to work?

EDIT 2: And just to ensure I'm not missing anything, I don't want to move my code away from my source tree. Is it possible to set the GoPath to a subdirectory (assuming that's how it's supposed to work)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant