aboutsummaryrefslogtreecommitdiffstats
path: root/models/action.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-12-25 09:59:32 +0000
committerGitHub <noreply@github.com>2020-12-25 11:59:32 +0200
commita19447aed128ecadfcd938d6a80cd4951af1f4ce (patch)
tree6312bf946d601aab29731645a4777feeaea66036 /models/action.go
parent04ae0f2f3f4556c6d0b4adc5f2cffd0cc7d25151 (diff)
downloadgitea-a19447aed128ecadfcd938d6a80cd4951af1f4ce.tar.gz
gitea-a19447aed128ecadfcd938d6a80cd4951af1f4ce.zip
migrate from com.* to alternatives (#14103)
* remove github.com/unknwon/com from models * dont use "com.ToStr()" * replace "com.ToStr" with "fmt.Sprint" where its easy to do * more refactor * fix test * just "proxy" Copy func for now * as per @lunny
Diffstat (limited to 'models/action.go')
-rw-r--r--models/action.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/models/action.go b/models/action.go
index c39fdc397a..ccf161192e 100644
--- a/models/action.go
+++ b/models/action.go
@@ -18,7 +18,6 @@ import (
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/timeutil"
- "github.com/unknwon/com"
"xorm.io/builder"
)
@@ -266,7 +265,7 @@ func (a *Action) GetIssueInfos() []string {
// GetIssueTitle returns the title of first issue associated
// with the action.
func (a *Action) GetIssueTitle() string {
- index := com.StrTo(a.GetIssueInfos()[0]).MustInt64()
+ index, _ := strconv.ParseInt(a.GetIssueInfos()[0], 10, 64)
issue, err := GetIssueByIndex(a.RepoID, index)
if err != nil {
log.Error("GetIssueByIndex: %v", err)
@@ -278,7 +277,7 @@ func (a *Action) GetIssueTitle() string {
// GetIssueContent returns the content of first issue associated with
// this action.
func (a *Action) GetIssueContent() string {
- index := com.StrTo(a.GetIssueInfos()[0]).MustInt64()
+ index, _ := strconv.ParseInt(a.GetIssueInfos()[0], 10, 64)
issue, err := GetIssueByIndex(a.RepoID, index)
if err != nil {
log.Error("GetIssueByIndex: %v", err)