We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Add
1 parent 3df76e7 commit 997ce53Copy full SHA for 997ce53
modules/templates/helper.go
@@ -120,7 +120,7 @@ func NewFuncMap() []template.FuncMap {
120
"Subtract": base.Subtract,
121
"EntryIcon": base.EntryIcon,
122
"MigrationIcon": MigrationIcon,
123
- "Add": func(a ...interface{}) int64 {
+ "Add": func(a ...interface{}) interface{} {
124
sum := int64(0)
125
126
for _, val := range a {
@@ -136,6 +136,15 @@ func NewFuncMap() []template.FuncMap {
136
}
137
138
139
+ if len(a) > 0 {
140
+ switch a[0].(type) {
141
+ case int:
142
+ return int(sum)
143
+ case int32:
144
+ return int32(sum)
145
+ }
146
147
+
148
return sum
149
},
150
"Mul": func(a ...int) int {
0 commit comments