conf getConf returns a copy

This commit is contained in:
Dan Ballard 2015-04-21 20:01:10 -07:00
parent 543d4c05d3
commit 2dc142a13b
1 changed files with 5 additions and 1 deletions

View File

@ -95,8 +95,12 @@ func saveConf() error {
return nil
}
// TODO: return copies
func GetConf() *Conf {
var confCopy *Conf = new(Conf)
confCopy.Deployments = make(map[string]Deployment)
for key, deployment := range(conf.Deployments) {
confCopy.Deployments[key] = deployment
}
return conf
}