On Sat, Apr 24, 2021 at 10:37 PM Shivendra Singh
<shivendra.singh3...@gmail.com> wrote:

> ..., now in the init() method it parses flag to read variables such as env 
> and app name that is required to load the appropriate config.

IINM, calling flag.Parse anywhere else than in main() or TestMain() is
not really compatible with what go test relies on.

flag.Parse changes shared state, doing it without coordination from
different places in order that might be not under the control of the
package that does it in its init() may create a mess that would be
consistent with your observation.

-- 
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/CAA40n-X1w9fHrcED5W3chHkKWf1DF6ac%2BZR2JNyhOD7hVV%3Db-g%40mail.gmail.com.

Reply via email to