You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:go-admin/modules/config/config.go
Lines 926 to 942 in 2c93e87
go-admin/modules/service/service.go
Lines 51 to 56 in 2c93e87
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
The text was updated successfully, but these errors were encountered: