Answer the question
In order to leave comments, you need to log in
How to import a package from a subpackage?
There is a main package with a module subpackage.
That is, in the project folder there are files
main.go and module/module.go
How do I understand how to import a module from main, but vice versa?
in module.go I write
import "../main" does not work
Answer the question
In order to leave comments, you need to log in
Found a solution:
make another subpackage
a function from this subpackage can be used from in the main module, and in another subpackage.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question