Refactor handlers: make Config not global

This commit is contained in:
Matthew Holt
2018-04-12 19:55:44 -06:00
parent 7dd5483ea3
commit b98c171644
5 changed files with 212 additions and 196 deletions

View File

@@ -229,11 +229,11 @@ func TestResticHandler(t *testing.T) {
}
}()
// globally set append-only mode and configure path
Config.AppendOnly = true
Config.Path = tempdir
mux := NewMux()
// set append-only mode and configure path
mux := NewHandler(Config{
AppendOnly: true,
Path: tempdir,
})
// create the repo
checkRequest(t, mux.ServeHTTP,