diff options
Diffstat (limited to 'modules/base/tool.go')
-rw-r--r-- | modules/base/tool.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/base/tool.go b/modules/base/tool.go index 5b066b2b9f..9635f13e0f 100644 --- a/modules/base/tool.go +++ b/modules/base/tool.go @@ -458,6 +458,16 @@ func (f StrTo) Int64() (int64, error) { return int64(v), err } +func (f StrTo) MustInt() int { + v, _ := f.Int() + return v +} + +func (f StrTo) MustInt64() int64 { + v, _ := f.Int64() + return v +} + func (f StrTo) String() string { if f.Exist() { return string(f) |