Remove redundant sprintf

This commit is contained in:
kolaente 2018-02-27 19:27:30 +01:00 committed by Gitea
parent 264f895967
commit 0c6f56d6c0
3 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)