From 1f93e29ec9f60cb01ee83e66dc35871a6a63956b Mon Sep 17 00:00:00 2001 From: Enrico Hoffmann Date: Fri, 8 Nov 2019 10:06:25 +0100 Subject: [PATCH] improve/shorten conditions --- send.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/send.go b/send.go index 3b81569..146c570 100644 --- a/send.go +++ b/send.go @@ -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 @@ -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 }