Skip to content

Commit

Permalink
improve/shorten conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
dasrick committed Nov 8, 2019
1 parent c72d263 commit 1f93e29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions send.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (c teamsClient) Send(webhookURL string, webhookMessage MessageCard) error {
// validate url
// needs to look like: https://outlook.office.com/webhook/xxx
valid, err := isValidWebhookURL(webhookURL)
if valid != true {
if !valid {
return err
}
// prepare message
Expand Down Expand Up @@ -83,7 +83,7 @@ func isValidWebhookURL(webhookURL string) (bool, error) {
}
// only pass MS teams webhook URLs
hasPrefix := strings.HasPrefix(webhookURL, "https://outlook.office.com/webhook/")
if hasPrefix != true {
if !hasPrefix {
err = errors.New("unvalid ms teams webhook url")
return false, err
}
Expand Down

0 comments on commit 1f93e29

Please sign in to comment.