3 ms·
One thing I'd like to see in Go, is the possibility to ask the compiler to not bother me for defined-but-not-used and/or imported when doing prototypes. You kn
by znpy 10y ago
One thing I'd like to see in Go, is the possibility to ask the compiler to not bother me for defined-but-not-used and/or imported when doing prototypes.
You know, "I just changed this little thing and I want to see what happens".
- ngrilly 10y agoHave you tried goimports? It helps a lot with this.
- hehheh 10y agoLet's say you comment out some line of code in go and go complains about an unused import. You run goimports and it removes the import. If you uncomment out that line of code and re-run goimports, will goimports automatically re-add the correct import statement every time?
- ngrilly 10y ago> Let's say you comment out some line of code in go and go complains about an unused import. If you setup your text editor to execute goimports on save, it won't happen, because the import will already be removed. > If you uncomment out that line of code and re-run goimports, will goimports automatically re-add the correct import statement every time? Most of the time, yes, but not every time. It works well for the standard library and when the last segment of the package name is enough to identify the package.