File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ t := template.New("example")
1919t.Funcs (tplfunc.New ())
2020
2121// Use in template / 在模板中使用
22- {{ Now | DateFormat " 2006-01-02" }}
23- {{ 100 | ToFixed 2 }}
22+ {{ Now. Format " 2006-01-02" }}
23+ {{ ToFixed 100 2 }}
2424{{ " hello world" | ToUpper }}
2525```
2626
@@ -33,10 +33,10 @@ t.Funcs(tplfunc.New())
3333| ` Now ` | 当前时间 / Current time | ` {{ Now }} ` |
3434| ` UnixTime ` | Unix时间戳 / Unix timestamp | ` {{ UnixTime }} ` |
3535| ` ElapsedMemory ` | 内存消耗 / Memory consumption | ` {{ ElapsedMemory }} ` |
36- | ` TotalRunTime ` | 运行时长(从启动服务时算起) / Runtime since service started | ` {{ TotalRunTime }} ` |
36+ | ` TotalRunTime ` | 运行时长(从启动服务时算起) / Run time since service started | ` {{ TotalRunTime }} ` |
3737| ` CaptchaForm ` | 验证码图片表单 / CAPTCHA image form | ` {{ CaptchaForm }} ` |
38- | ` FormatByte ` | 字节转为适合理解的格式 / Bytes to human-readable format | ` {{ 1024 \| FormatByte }} ` |
39- | ` FormatBytes ` | 字节转为适合理解的格式 / Bytes to human-readable format | ` {{ 1024 \| FormatBytes }} ` |
38+ | ` FormatByte ` | 字节数转为适合理解的格式 / Bytes to human-readable format | ` {{ 1024 \| FormatByte }} ` |
39+ | ` FormatBytes ` | 字节数转为适合理解的格式 / Bytes to human-readable format | ` {{ 1024 \| FormatBytes }} ` |
4040| ` FriendlyTime ` | 友好的时间格式 / Human-friendly time format | ` {{ 3600 \| FriendlyTime }} ` |
4141| ` FormatPastTime ` | 以前距离现在多长时间 / Time elapsed since past | ` {{ 1609459200 \| FormatPastTime }} ` |
4242| ` DateFormat ` | 日期格式化 / Date format | ` {{ 1609459200 \| DateFormat "2006-01-02" }} ` |
You can’t perform that action at this time.
0 commit comments