summaryrefslogtreecommitdiffstats
path: root/modules/base
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-27 19:42:10 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-27 19:42:10 -0400
commiteb6021f73f270b6fad937432964ab15f42e8f0d9 (patch)
tree4b6d560c60e41cfec3a20a9ecf6144c27a3353df /modules/base
parent34f4af9ebf179dbb24a7da6091b4259d66a3c426 (diff)
downloadgitea-eb6021f73f270b6fad937432964ab15f42e8f0d9.tar.gz
gitea-eb6021f73f270b6fad937432964ab15f42e8f0d9.zip
Fix issue pages URL params
Diffstat (limited to 'modules/base')
-rw-r--r--modules/base/tool.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/modules/base/tool.go b/modules/base/tool.go
index 6f4fbe8366..9ddb90f721 100644
--- a/modules/base/tool.go
+++ b/modules/base/tool.go
@@ -412,6 +412,11 @@ func (f StrTo) Int() (int, error) {
return int(v), err
}
+func (f StrTo) Int64() (int64, error) {
+ v, err := strconv.ParseInt(f.String(), 10, 64)
+ return int64(v), err
+}
+
func (f StrTo) String() string {
if f.Exist() {
return string(f)
@@ -541,16 +546,10 @@ func ActionDesc(act Actioner, avatarLink string) string {
}
func DiffTypeToStr(diffType int) string {
- switch diffType {
- case 1:
- return "add"
- case 2:
- return "modify"
- case 3:
- return "del"
- default:
- return "unknown"
+ diffTypes := map[int]string{
+ 1: "add", 2: "modify", 3: "del",
}
+ return diffTypes[diffType]
}
func DiffLineTypeToStr(diffType int) string {