On Python the circular imports are usually handled by issuing it inside the function needing it.
module_A.function_one needs module_B.function_one, but module_B.method_two can need module_A.helper_two, that is evaluated on run time. This makes the A -> B -> A work by letting the B -> be lazy.
However Go does not allow it. The solution was to bubble up all the imports to the main.go, as it was before the PEP-3147 (__pycache__) support got added.
This is needed, e.g., by zipfile.py that imports shutil.py that conditionally imports zipfile.py
On Python the circular imports are usually handled by issuing it inside the function needing it.
module_A.function_one needs module_B.function_one, but module_B.method_two can need module_A.helper_two, that is evaluated on run time. This makes the A -> B -> A work by letting the B -> be lazy.
However Go does not allow it. The solution was to bubble up all the imports to the main.go, as it was before the PEP-3147 (
__pycache__
) support got added.This is needed, e.g., by zipfile.py that imports shutil.py that conditionally imports zipfile.py