You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We know that circular dependencies a banned just because of linking process. Compiler must be fast as possible. But if we can show our agreement to be slightly slow here, like
import (
...
name "path/to/our/circular/importer" `compile:"together"`
)
this tag forces compiler always to compile this two packages together in to single .o
Yes, compilation process now will be slowed down, but another side of this coin is dedicated package with interfaces and indirect calling in runtime.
Another look at this is copackages, in fact it is a single package, but have different namespaces.
also we can do a lot more stuff with this import tags.
The text was updated successfully, but these errors were encountered:
This was asked several times in the past, including the recent #30247 (for Go2). It has always been rejected. In particular, see: #30247 (comment) and #30247 (comment).
The consensus in the Go team about allowed circular imports not happening, ever, even in Go2, seems to be quite strong, so I'm closing this issue as a dup of #30247.
在 2019年3月21日,下午5:11,Vany Serezhkin ***@***.***> 写道:
We know that circular dependencies a banned just because of linking process. Compiler must be fast as possible. But if we can show our agreement to be slightly slow here, like
import (
...
name "path/to/our/circular/importer" `compile:"together"`
)
this tag forces compiler always to compile this two packages together in to single .o
Yes, compilation process now will be slowed down, but another side of this coin is dedicated package with interfaces and indirect calling in runtime.
Another look at this is copackages, in fact it is a single package, but have different namespaces.
also we can do a lot more stuff with this import tags.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#30974>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AT71j6p9lUEzDsUf6Agw42uRLArX0lEpks5vY0yugaJpZM4cA-vG>.
We know that circular dependencies a banned just because of linking process. Compiler must be fast as possible. But if we can show our agreement to be slightly slow here, like
this tag forces compiler always to compile this two packages together in to single .o
Yes, compilation process now will be slowed down, but another side of this coin is dedicated package with interfaces and indirect calling in runtime.
Another look at this is copackages, in fact it is a single package, but have different namespaces.
also we can do a lot more stuff with this import tags.
The text was updated successfully, but these errors were encountered: