-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Proposal: Re-export packages with shorter names (g, h, c) #151
Comments
Hi @eduardolat, thank you for taking the time to create an issue! I think this is usually something you can set up in your editor. Either you could have it not delete unused imports, or use an editor that supports importing with aliases. GoLand (from Jetbrains) usually does this quite well, I don't know about other editors. Alternatively, wait with saving the file until you've used the import. This isn't something I want to add to the library. If you editor doesn't support some of my proposed solutions, maybe you can file an issue with the makers of your editor? I hope you find a good solution. 😊 |
Thaks @markuswustenberg for your response. I think I'll just use the imports without aliases (gomponents, html, components instead of g, h, c). I'm going to find out about configurations for vscode that solve this in the best possible way, thank you very much for your contributions to the community. |
I'm glad you found a workaround that works for you. Feel free to post a solution here if you ever find one! |
The problem:
Right now in the docs it is recommended to import library packages with aliases:
The problem comes when the file is saved, if an import is not being used then go fmt deletes it.
This is a problem because to import packages with aliases there is usually no help from the editor, so you must memorize the import, copy and paste it or create snippets to import the packages.
As you can well imagine, this kills productivity and completely takes you out of the flow state.
Proposed solution:
My proposal to solve this problem is to simply re-export the functions of the 3 main packages so that our import looks like this:
This would attack the problem directly by allowing our code editor tools to auto-import the package without having to write aliases or do it manually, which would be of great help to improve our productivity.
The text was updated successfully, but these errors were encountered: