Last active
June 9, 2018 15:12
-
-
Save r6m/0aad1b710be898252fa0ca1c28cc42b5 to your computer and use it in GitHub Desktop.
golang template using delimeter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{$equipment := .Equipment}} | |
{{ range $index, $element := .Equipment}} | |
{{if $index}},{{end}} | |
{{$element.Name}} | |
{{end}} | |
// or if it's an array | |
// then register a function using template.Funcs(templte.FuncMap{"Join", strings.Join}) | |
{{ Join .Array ", " }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment