A
A
Artem Prokhorov2021-12-19 20:24:48
go
Artem Prokhorov, 2021-12-19 20:24:48

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

1 answer(s)
U
uvelichitel, 2021-12-19
@kotcich

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 question

Ask a Question

731 491 924 answers to any question