Hi!!

I have a use case as following :
1. There is a go program that is used for managing run time configs of our 
applications. (basically all our run time configs are in GitHub and this 
code reads and provides to app based on certain run time args as mentioned 
below) This program is added as go mod dependency and exposes certain 
functions like GetString(key).
2. This program is a client program and does not contain any main() however 
makes use of init() method on client app startup. Therefore whenever i 
start my application, this code runs it's init() method, 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.

The Problem :
All works fine, in the actual code, however whenever i try to run the unit 
test cases i get error message like : 

*flag provided but not defined: -test.paniconexit0*
*  -appName string*
*        app name*
*  -envName string*
*        environment name*

I tried to provide args when running test like :
*go test -appName  appName -envName dev*

However the approach seems not to be working. I have read at a few places 
about using something like :
*var _ = func() bool {*
* testing.Init()*
*return true*
*}()*
But it did not helped me either in this case.
I am only 1 months old in go so any help will be greatly appreciated.

Thank You in Advance!!

-- 
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/abad1720-f76b-4028-a701-a6ed6b941812n%40googlegroups.com.

Reply via email to