Skip to content

Commit

Permalink
internal: remove redundant use of 'host'
Browse files Browse the repository at this point in the history
The `host` variable is already set, during the program startup, when the CI
functions are ran. With that, instead of fetching the information again, use
the one already available.

Signed-off-by: Bruno Meneguele <bmeneg@redhat.com>
  • Loading branch information
bmeneg committed Aug 9, 2021
1 parent 5a1fd5d commit 6947303
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions internal/gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (

"github.com/pkg/errors"
gitlab "github.com/xanzy/go-gitlab"
"github.com/zaquestion/lab/internal/config"
"github.com/zaquestion/lab/internal/git"
"github.com/zaquestion/lab/internal/logger"
)
Expand Down Expand Up @@ -1278,7 +1277,6 @@ func CIJobs(pid interface{}, id int, followBridge bool) ([]JobStruct, error) {
// search for.
// WebURL format:
// <core.host>/<bridged-project-name-with-namespace>/-/pipelines/<id>
host := config.MainConfig.GetString("core.host")
projectName := strings.Replace(bridge.DownstreamPipeline.WebURL, host+"/", "", 1)
pipelineText := fmt.Sprintf("/-/pipelines/%d", bridge.DownstreamPipeline.ID)
projectName = strings.Replace(projectName, pipelineText, "", 1)
Expand Down

0 comments on commit 6947303

Please sign in to comment.