From 0c6f56d6c03c8fb2383caec1c1e5932258c5a839 Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 27 Feb 2018 19:27:30 +0100 Subject: [PATCH] Remove redundant sprintf --- routers/api/v1/repo/issue.go | 4 ++-- routers/api/v1/repo/pull.go | 2 +- routers/repo/issue.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go index afe190a41..eedac7677 100644 --- a/routers/api/v1/repo/issue.go +++ b/routers/api/v1/repo/issue.go @@ -175,7 +175,7 @@ func CreateIssue(ctx *context.APIContext, form api.CreateIssueOption) { if form.Closed { if err := issue.ChangeStatus(ctx.User, ctx.Repo.Repository, true); err != nil { if models.IsErrDependenciesLeft(err) { - ctx.Error(http.StatusPreconditionFailed, "", fmt.Sprintf("cannot close this issue because it still has open dependencies")) + ctx.Error(http.StatusPreconditionFailed, "", "cannot close this issue because it still has open dependencies") return } ctx.Error(500, "ChangeStatus", err) @@ -286,7 +286,7 @@ func EditIssue(ctx *context.APIContext, form api.EditIssueOption) { if form.State != nil { if err = issue.ChangeStatus(ctx.User, ctx.Repo.Repository, api.StateClosed == api.StateType(*form.State)); err != nil { if models.IsErrDependenciesLeft(err) { - ctx.Error(http.StatusPreconditionFailed, "", fmt.Sprintf("cannot close this issue because it still has open dependencies")) + ctx.Error(http.StatusPreconditionFailed, "", "cannot close this issue because it still has open dependencies") return } ctx.Error(500, "ChangeStatus", err) diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go index ef7edb737..17710c0a9 100644 --- a/routers/api/v1/repo/pull.go +++ b/routers/api/v1/repo/pull.go @@ -368,7 +368,7 @@ func EditPullRequest(ctx *context.APIContext, form api.EditPullRequestOption) { if form.State != nil { if err = issue.ChangeStatus(ctx.User, ctx.Repo.Repository, api.StateClosed == api.StateType(*form.State)); err != nil { if models.IsErrDependenciesLeft(err) { - ctx.Error(http.StatusPreconditionFailed, "", fmt.Sprintf("cannot close this pull request because it still has open dependencies")) + ctx.Error(http.StatusPreconditionFailed, "", "cannot close this pull request because it still has open dependencies") return } ctx.Error(500, "ChangeStatus", err) diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 579dd2ac0..5bc17793f 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -957,7 +957,7 @@ func UpdateIssueStatus(ctx *context.Context) { for _, issue := range issues { if err := issue.ChangeStatus(ctx.User, issue.Repo, isClosed); err != nil { if models.IsErrDependenciesLeft(err) { - ctx.Error(http.StatusPreconditionFailed, "", fmt.Sprintf("cannot close this issue because it still has open dependencies")) + ctx.Error(http.StatusPreconditionFailed, "", "cannot close this issue because it still has open dependencies") return } ctx.ServerError("ChangeStatus", err)