Move configuration into the config packge
Review Request #9771 — Created March 13, 2018 and submitted — Latest diff uploaded
We now have a
config.Configstruct which contains all the data in the
configuration file. Unfortunately, we still need a global config since
the routes do not have access to state. TheglobalConfigvariable and
config.Get{Field}methods will be removed in a future path, which will
clean up a lot of testing infrastructure to not require writing changes
to disk.The cleanup involved updating all the tests in
routes_tests.go, so I
removed the setup/tearddown methods, which are not very idiomatic for go
unit tests and since you cannot defer into a parent scope it make sense
to have the following pattern:state := helpers.SetUp(t, ...) defer helpers.TearDown(t, state)for all the resources in a unit test.
Ran unit tests.