Add first & last helpers
This commit is contained in:
parent
3b5a2eeafe
commit
2ab581a1d6
@ -29,6 +29,12 @@ var ProtoHelpersFuncMap = template.FuncMap{
|
|||||||
a, _ := json.MarshalIndent(v, "", " ")
|
a, _ := json.MarshalIndent(v, "", " ")
|
||||||
return string(a)
|
return string(a)
|
||||||
},
|
},
|
||||||
|
"first": func(a []string) string {
|
||||||
|
return a[0]
|
||||||
|
},
|
||||||
|
"last": func(a []string) string {
|
||||||
|
return a[len(a)-1]
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
type GenericTemplateBasedEncoder struct {
|
type GenericTemplateBasedEncoder struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user