File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package serra
33import (
44 "net/http"
55 "strconv"
6+ "text/template"
67
78 "github.com/gin-gonic/gin"
89 "github.com/spf13/cobra"
@@ -16,6 +17,10 @@ func init() {
1617 rootCmd .AddCommand (webCmd )
1718}
1819
20+ func add (a , b int64 ) int64 {
21+ return a + b
22+ }
23+
1924var webCmd = & cobra.Command {
2025 Aliases : []string {"a" },
2126 Use : "web" ,
@@ -38,6 +43,9 @@ type Query struct {
3843
3944func startWeb () error {
4045 router := gin .Default ()
46+ router .SetFuncMap (template.FuncMap {
47+ "add" : add ,
48+ })
4149 router .LoadHTMLGlob ("templates/*.tmpl" )
4250 router .Static ("/assets" , "./assets" )
4351
Original file line number Diff line number Diff line change 168168 <tbody>
169169 {{range .cards }}
170170 <tr>
171- <td>{{.SerraCount }}</td>
171+ <td>{{ add .SerraCount .SerraCountFoil }}</td>
172172 <td>
173173 <div class= " cardpreview" ><strong>{{.Name }}</strong>
174174 <span class= " cardpreviewtext" >
You can’t perform that action at this time.
0 commit comments