You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
So I have a lib directory at the root of my project.
I try to import it correctly: "github.com/package-name/lib"
And this tool just makes it disappear! Poof 💥 🚀
I am trying to just import the functions, not force myself to do:
import (
lib "github.com/user/package-name/lib"
)
// and then do something likefuncmain() {
lib.ExportedFunction()
}
I would prefer (since this is an internal library to the package) to do something like:
import (
"github.com/user/package-name/lib"
)
// and then do something likefuncmain() {
ExportedFunction()
}
if I am just doing something wrong please let me know
GIF showing what is happening
I save my work, then it gets rid of it 😂
Conclusion
How am I supposed to import this while using this wonderful tool? 🤔
Unless of course this is convention pushed by the linter then I apologize in advance for all of this!
If this is indeed convention, the dropdown should auto match the ending dir name (possibly).
Ex: "github.com/user/package-name/foo" to auto make foo "github.com/user/package-name/foo" if this is going to be forced from a stylistic point of view 😄
The text was updated successfully, but these errors were encountered:
I had a similar problem (in my case, adding undesired/wrong imports) and my workaround was to change the format tool to gofmt. This user setting should do the trick:
Removed the lib "github.com/selfup/go-cache-http/lib" line from the import block in main.go file
Saved the file
Instead of getting the error on missing import, the missing import got added when I saved the file.
This is because the default formatting tool goreturns adds missing imports and removes unused imports.
Is there anything else I should have done to get a repro?
👋
Here is the repo I am using (to help us all figure out what is going on here): https://github.com/selfup/go-cache-http
Current workaround:
https://github.com/selfup/go-cache-http/blob/master/main.go#L8
Problem
There is a UI bug
So I have a
lib
directory at the root of my project.I try to import it correctly:
"github.com/package-name/lib"
And this tool just makes it disappear! Poof 💥 🚀
I am trying to just import the functions, not force myself to do:
I would prefer (since this is an internal library to the package) to do something like:
if I am just doing something wrong please let me know
GIF showing what is happening
I save my work, then it gets rid of it 😂
Conclusion
How am I supposed to import this while using this wonderful tool? 🤔
Unless of course this is convention pushed by the linter then I apologize in advance for all of this!
If this is indeed convention, the dropdown should auto match the ending dir name (possibly).
Ex:
"github.com/user/package-name/foo"
to auto makefoo "github.com/user/package-name/foo"
if this is going to be forced from a stylistic point of view 😄The text was updated successfully, but these errors were encountered: