There are a number of global variables used throughout the code base. When trying to use normal gin testing practices where a routing engine is embedded in a Server struct, it is impossible to reconfigure the database or services without encountering panic()'s. For instance:
Bug Description
There are a number of global variables used throughout the code base. When trying to use normal
gin
testing practices where a routing engine is embedded in a Server struct, it is impossible to reconfigure the database or services without encounteringpanic()
's. For instance:How to reproduce [describe the steps how to reproduce the bug]
Call
engine.AddConfig()
twice in the same running process:https://github.com/GoAdminGroup/example/blob/ffac70b8ea3a48080022f0057a128d62a733ebaf/main.go#L58-L63
Run the above, or whatever, in the equivalent of:
Expect [describe your expect result]
I expect this to work w/o any panics. I'd like to figure out how to use go-admin without sacrificing standard testing practices.
Versions