From 1e93d37921422ce155003c7d87b769b5eff022e9 Mon Sep 17 00:00:00 2001 From: Pavel Simzicov Date: Sun, 30 Apr 2023 10:33:29 +0200 Subject: [PATCH] Applied code style fixes --- helper.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/helper.go b/helper.go index 95bb484..710db3b 100644 --- a/helper.go +++ b/helper.go @@ -9,12 +9,12 @@ import ( func extractInfoFromConversationVariables(message dto.BaseChatMessage) (pullRequests []PullRequest, pipeline string, repositories []string, err error) { pipeline = getFromVariable(message, stepWhatPipeline) - if "" == pipeline { + if pipeline == "" { return pullRequests, pipeline, repositories, errors.New("Invalid pipeline value received.") } target := getFromVariable(message, stepWhatDestination) - if "" == target { + if target == "" { return pullRequests, pipeline, repositories, errors.New("Invalid target value received.") } @@ -38,6 +38,9 @@ func extractInfoFromString(text string) (receivedPullRequests []PullRequest, pip } pipeline, err = extractPipeline(text) + if err != nil { + return nil, "", nil, errors.Wrap(err, "Failed to extract pipeline from the string") + } repositories, err = extractRepositoriesFromString(text) if err != nil { return nil, "", nil, errors.Wrap(err, "Failed to parse repositories from the string")