Skip to content

Commit

Permalink
Remove useless checks
Browse files Browse the repository at this point in the history
  • Loading branch information
hsluoyz committed Aug 19, 2023
1 parent 50d0fca commit 94e40fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
12 changes: 2 additions & 10 deletions casdoorsdk/email.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@

package casdoorsdk

import (
"encoding/json"
"fmt"
)
import "encoding/json"

type emailForm struct {
Title string `json:"title"`
Expand All @@ -38,14 +35,9 @@ func (c *Client) SendEmail(title string, content string, sender string, receiver
return err
}

resp, err := c.DoPost("send-email", nil, postBytes, false, false)
_, err = c.DoPost("send-email", nil, postBytes, false, false)
if err != nil {
return err
}

if resp.Status != "ok" {
return fmt.Errorf(resp.Msg)
}

return nil
}
8 changes: 0 additions & 8 deletions casdoorsdk/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,6 @@ func (c *Client) UploadResource(user string, tag string, parent string, fullFile
return "", "", err
}

if resp.Status != "ok" {
return "", "", fmt.Errorf(resp.Msg)
}

fileUrl := resp.Data.(string)
name := resp.Data2.(string)
return fileUrl, name, nil
Expand All @@ -158,10 +154,6 @@ func (c *Client) UploadResourceEx(user string, tag string, parent string, fullFi
return "", "", err
}

if resp.Status != "ok" {
return "", "", fmt.Errorf(resp.Msg)
}

fileUrl := resp.Data.(string)
name := resp.Data2.(string)
return fileUrl, name, nil
Expand Down

0 comments on commit 94e40fd

Please sign in to comment.