fix errcheck issue (#28618)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7ff22436dc
Коммит
dfa29c2b59
@@ -82,7 +82,6 @@ issues:
|
||||
channels/api4/post_test.go|\
|
||||
channels/api4/preference_test.go|\
|
||||
channels/api4/reaction_test.go|\
|
||||
channels/api4/remote_cluster.go|\
|
||||
channels/api4/role.go|\
|
||||
channels/api4/saml.go|\
|
||||
channels/api4/scheme.go|\
|
||||
|
||||
@@ -126,7 +126,9 @@ func remoteClusterAcceptMessage(c *Context, w http.ResponseWriter, r *http.Reque
|
||||
return
|
||||
}
|
||||
|
||||
w.Write(b)
|
||||
if _, err := w.Write(b); err != nil {
|
||||
c.Logger.Warn("Error while writing response", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
func remoteClusterConfirmInvite(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
@@ -235,7 +237,11 @@ func uploadRemoteData(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func remoteSetProfileImage(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
defer io.Copy(io.Discard, r.Body)
|
||||
defer func() {
|
||||
if _, err := io.Copy(io.Discard, r.Body); err != nil {
|
||||
c.Logger.Warn("Error while reading request body", mlog.Err(err))
|
||||
}
|
||||
}()
|
||||
|
||||
c.RequireUserId()
|
||||
if c.Err != nil {
|
||||
@@ -344,7 +350,9 @@ func getRemoteClusters(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
w.Write(b)
|
||||
if _, err := w.Write(b); err != nil {
|
||||
c.Logger.Warn("Error while writing response", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
func createRemoteCluster(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
@@ -424,7 +432,9 @@ func createRemoteCluster(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
w.Write(b)
|
||||
if _, err := w.Write(b); err != nil {
|
||||
c.Logger.Warn("Error while writing response", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
func remoteClusterAcceptInvite(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
@@ -491,7 +501,9 @@ func remoteClusterAcceptInvite(c *Context, w http.ResponseWriter, r *http.Reques
|
||||
}
|
||||
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
w.Write(b)
|
||||
if _, err := w.Write(b); err != nil {
|
||||
c.Logger.Warn("Error while writing response", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
func generateRemoteClusterInvite(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Ссылка в новой задаче
Block a user