From 2dc142a13b69b2d959fed5f566cccc2869cd730d Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Tue, 21 Apr 2015 20:01:10 -0700 Subject: [PATCH] conf getConf returns a copy --- cmd/warrend/conf/conf.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/warrend/conf/conf.go b/cmd/warrend/conf/conf.go index c217e3c..8062985 100644 --- a/cmd/warrend/conf/conf.go +++ b/cmd/warrend/conf/conf.go @@ -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 }