From a0dee7c40ad8a888bc5f9feb93e8107a2e0830b6 Mon Sep 17 00:00:00 2001 From: Virgil Date: Thu, 2 Apr 2026 02:47:06 +0000 Subject: [PATCH] chore: expose client base url Co-Authored-By: Virgil --- client.go | 5 +++++ forge_test.go | 3 +++ 2 files changed, 8 insertions(+) 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) {