diff --git a/client.go b/client.go index 472354c..9fac2db 100644 --- a/client.go +++ b/client.go @@ -117,6 +117,11 @@ type Client struct { rateLimit RateLimit } +// BaseURL returns the configured Forgejo base URL. +func (c *Client) BaseURL() string { + return c.baseURL +} + // RateLimit returns the last known rate limit information. func (c *Client) RateLimit() RateLimit { return c.rateLimit diff --git a/forge_test.go b/forge_test.go index b77ad93..af1ce57 100644 --- a/forge_test.go +++ b/forge_test.go @@ -33,6 +33,9 @@ func TestForge_Client_Good(t *testing.T) { if c.baseURL != "https://forge.lthn.ai" { t.Errorf("got baseURL=%q", c.baseURL) } + if got := c.BaseURL(); got != "https://forge.lthn.ai" { + t.Errorf("got BaseURL()=%q", got) + } } func TestRepoService_ListOrgRepos_Good(t *testing.T) {