Skip to content

Commit

Permalink
internal: handle empty API URL from env
Browse files Browse the repository at this point in the history
  • Loading branch information
giautm committed Jan 2, 2025
1 parent 67c0c25 commit ccadef9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/bitbucket/bitbucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ func NewClient(workspace, repoSlug string, opts ...ClientOption) (*Client, error
return nil, err
}
}
if c.baseURL == "" {
c.baseURL = DefaultBaseURL
}
return c, nil
}

Expand Down
3 changes: 3 additions & 0 deletions internal/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ func NewClient(repo string, opts ...ClientOption) (*Client, error) {
return nil, err
}
}
if c.baseURL == "" {
c.baseURL = DefaultBaseURL
}
return c, nil
}

Expand Down
3 changes: 3 additions & 0 deletions internal/gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ func NewClient(project string, opts ...ClientOption) (*Client, error) {
return nil, err
}
}
if c.baseURL == "" {
c.baseURL = DefaultBaseURL
}
return c, nil
}

Expand Down

0 comments on commit ccadef9

Please sign in to comment.