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

Autoimport #162

Open
muhmud opened this issue Oct 11, 2024 · 2 comments
Open

Autoimport #162

muhmud opened this issue Oct 11, 2024 · 2 comments

Comments

@muhmud
Copy link

muhmud commented Oct 11, 2024

Would it be possible to have an option to auto-import based on the current directory's go.mod?

I'm thinking of something like the gore -autoimport option.

@cosmos72
Copy link
Owner

You can import "." to load whatever Go module is present the current directory.

So maybe something like

gomacro -e 'import "."' -i

should suffice?

@muhmud
Copy link
Author

muhmud commented Oct 23, 2024

I get an error when trying to do this, unfortunately:

repl.go:1:8: error importing packages ... error loading packages ... metadata: -: no required module provides package

It tells me to try adding the package using go get, though from the debug output it seems like it did this already.

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

2 participants