diff options
author | Chris <ccbrown112@gmail.com> | 2017-10-18 15:36:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-18 15:36:43 -0700 |
commit | 8e19ba029f889519d93cf272960dce858971106c (patch) | |
tree | d8f38ac62661fb8578e2b5c3c619fe31ab29f480 /app/app.go | |
parent | 34a87fa8f47b1447b73e3ae56866b654801b3eee (diff) | |
download | chat-8e19ba029f889519d93cf272960dce858971106c.tar.gz chat-8e19ba029f889519d93cf272960dce858971106c.tar.bz2 chat-8e19ba029f889519d93cf272960dce858971106c.zip |
Reduce utils.Cfg references (#7650)
* app.UpdateConfig method
* test fix
* another test fix
* the config override option as-was is just error prone, remove it for now
* derp
Diffstat (limited to 'app/app.go')
-rw-r--r-- | app/app.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/app.go b/app/app.go index 34c0721a0..c82520cd9 100644 --- a/app/app.go +++ b/app/app.go @@ -47,8 +47,7 @@ type App struct { Mfa einterfaces.MfaInterface Saml einterfaces.SamlInterface - newStore func() store.Store - configOverride func(*model.Config) *model.Config + newStore func() store.Store } var appCount = 0 @@ -234,12 +233,13 @@ func (a *App) initEnterprise() { } func (a *App) Config() *model.Config { - if a.configOverride != nil { - return a.configOverride(utils.Cfg) - } return utils.Cfg } +func (a *App) UpdateConfig(f func(*model.Config)) { + f(utils.Cfg) +} + // Go creates a goroutine, but maintains a record of it to ensure that execution completes before // the app is destroyed. func (a *App) Go(f func()) { |