Replacing usages of fmt.Sprint with faster alternatives

Signed-off-by: Philippe Antoine <contact@catenacyber.fr>
Этот коммит содержится в:
Catena cyber
2023-11-03 11:18:18 +01:00
коммит произвёл GitHub
родитель 43f4734eae
Коммит 04e7b6bc9e
8 изменённых файлов: 21 добавлений и 19 удалений

Просмотреть файл

@@ -7,9 +7,9 @@ import (
"bytes"
"encoding/binary"
"encoding/json"
"fmt"
"io"
"net/http"
"strconv"
"time"
"github.com/pkg/errors"
@@ -180,7 +180,7 @@ func selfHostedConfirm(c *Context, w http.ResponseWriter, r *http.Request) {
c.App.NotifySelfHostedSignupProgress(confirmResponse.Progress, user.Id)
}
if err.Error() == fmt.Sprintf("%d", http.StatusUnprocessableEntity) {
if err.Error() == strconv.Itoa(http.StatusUnprocessableEntity) {
c.Err = model.NewAppError(where, "api.cloud.app_error", nil, "", http.StatusUnprocessableEntity).Wrap(err)
return
}
@@ -365,7 +365,7 @@ func selfHostedConfirmExpand(c *Context, w http.ResponseWriter, r *http.Request)
c.App.NotifySelfHostedSignupProgress(confirmResponse.Progress, user.Id)
}
if err.Error() == fmt.Sprintf("%d", http.StatusUnprocessableEntity) {
if err.Error() == strconv.Itoa(http.StatusUnprocessableEntity) {
c.Err = model.NewAppError(where, "api.cloud.app_error", nil, "", http.StatusUnprocessableEntity).Wrap(err)
return
}