I have an init() function in a package.
In same package, I have a test file (that imports "testing") with also an
init() function, because I want to initialize some global variables used by
the test functions.

The problem is that init() in test file runs before init() in package.

Is there a means to make the init() in test file run after init() of the
package ?

Or is it desirable that Go runs init() in test file AFTER all the other
init() ?

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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 8 | next ›
Discussion Overview
groupgolang-nuts @
postedAug 16, '15 at 7:25p
activeAug 17, '15 at 1:20a



site design / logo © 2021 Grokbase