Skip to content

Commit

Permalink
add join template function
Browse files Browse the repository at this point in the history
  • Loading branch information
kelseyhightower committed Dec 9, 2014
1 parent 30da29c commit 195e192
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ dir: {{.}}
{{end}}
```

### join

Alias for the strings.Join function.

```
{{$services := getvs "/services/elasticsearch/*"}}
services: {{join $services ","}}
```

## Example Usage

```Bash
Expand Down
1 change: 1 addition & 0 deletions resource/template/template_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ func newFuncMap() map[string]interface{} {
m["jsonArray"] = UnmarshalJsonArray
m["dir"] = path.Dir
m["getenv"] = os.Getenv
m["join"] = strings.Join
return m
}

Expand Down

0 comments on commit 195e192

Please sign in to comment.