Answer the question
In order to leave comments, you need to log in
How to use an imported package without duplicating imports?
2 files: main.go and sum.go.
When importing any third party package in main, I don't see it in sum and vice versa.
How to import 1 time and use in all files of my package?
Answer the question
In order to leave comments, you need to log in
So intended. An imported package is only visible in the file it is imported into. This is not a bug, but a feature)) This is documented.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question