Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f407061

Browse files
committed
1024程序员节
1 parent cceb869 commit f407061

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/http/http.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"global"
1313
"html/template"
1414
"logic"
15+
"math/rand"
1516
"model"
1617
"net/http"
1718
"path/filepath"
@@ -109,6 +110,13 @@ var funcMap = template.FuncMap{
109110
}
110111
return total
111112
},
113+
"mod": func(num1, num2 int) int {
114+
if num1 == 0 {
115+
num1 = rand.Intn(500)
116+
}
117+
118+
return num1 % num2
119+
},
112120
"explode": func(s, sep string) []string {
113121
return strings.Split(s, sep)
114122
},

static/img/activity/1024-0.jpg

86 KB
Loading

static/img/activity/1024-1.jpg

88.2 KB
Loading

0 commit comments

Comments
 (0)