Skip to content

Commit

Permalink
Merge pull request #2 from dasrick/mockery
Browse files Browse the repository at this point in the history
add mock file and update deps
  • Loading branch information
dasrick authored Nov 8, 2019
2 parents bc0163b + c6640ae commit feea812
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 5 deletions.
29 changes: 26 additions & 3 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions mocks/API.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 feea812

Please sign in to comment.