Skip to content

Commit

Permalink
gofmt FTW
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzy committed May 28, 2014
1 parent cd99c2a commit 589557b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion resource/template/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (t *TemplateResource) createStageFile() error {
tplFuncMap["Base"] = path.Base

tplFuncMap["GetDir"] = t.Dirs.Get
tplFuncMap["MapDir"] = mapNodes
tplFuncMap["MapDir"] = mapNodes
tmpl := template.Must(template.New(path.Base(t.Src)).Funcs(tplFuncMap).ParseFiles(t.Src))
if err = tmpl.Execute(temp, t.Vars); err != nil {
return err
Expand Down
18 changes: 9 additions & 9 deletions resource/template/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"strings"
"syscall"

"github.com/coreos/go-etcd/etcd"
"github.com/kelseyhightower/confd/log"
"github.com/coreos/go-etcd/etcd"
)

func appendPrefix(prefix string, keys []string) []string {
Expand All @@ -37,14 +37,14 @@ func cleanKeys(vars map[string]interface{}, prefix string) map[string]interface{

func mapNodes(node *etcd.Node) map[string]interface{} {
result := make(map[string]interface{})
for _, node := range node.Nodes {
if len(node.Nodes) > 0 {
result[node.Key] = node.Nodes
} else {
result[node.Key] = node.Value
}
}
return cleanKeys(result, node.Key)
for _, node := range node.Nodes {
if len(node.Nodes) > 0 {
result[node.Key] = node.Nodes
} else {
result[node.Key] = node.Value
}
}
return cleanKeys(result, node.Key)
}

// isFileExist reports whether path exits.
Expand Down

0 comments on commit 589557b

Please sign in to comment.