sorry. i misunderstood your question. the paragraph you quoted refers to
reference to methods values (t.m) or expressions (T.m) and not method
calls t.m() as in your example. does that help solve the question?
On 08.07.19 20:09, Martin Schnabel wrote:
On 08.07.19 02:51, Il-seob Bae wrote:
As per the spec <https://golang.org/ref/spec#Package_initialization>,
A reference to a method m is a method value or method expression of
the form t.m, where the (static) type of t is not an interface type,
and the method m is in the method set of t. It is immaterial whether
the resulting function value t.m is invoked.
In other words, the mere presence of an interface variable guarantees
/no/ dependency analysis? Here, I did a test
<https://play.golang.org/p/8Fo4nUgGLBP>, but it indeed suffers the
analysis. Any thoughts?
The key part is that i has dependencies and is not ready and d has no
dependencies and is ready for initialization. If you change the
initialization expression of d from a constant to a function you see
initialization in source order.
https://play.golang.org/p/0D8Lxw_KBz-
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/0f2e0bf3-d156-8507-155c-620f41342ede%40mb0.org.
For more options, visit https://groups.google.com/d/optout.