From f5c63cde56eb35c0125a0545f084441cdd4340ab Mon Sep 17 00:00:00 2001 From: Keuin Date: Tue, 11 Jul 2023 22:56:07 +0800 Subject: Refactor: move data structures to a separate package to avoid circular dependency. --- bilibili/request.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bilibili/request.go') diff --git a/bilibili/request.go b/bilibili/request.go index 2e4b57e..fa31b19 100644 --- a/bilibili/request.go +++ b/bilibili/request.go @@ -2,6 +2,7 @@ package bilibili import ( "encoding/json" + "github.com/keuin/slbr/types" "io" "net" "net/http" @@ -29,7 +30,7 @@ func (b Bilibili) newGet(url string) (req *http.Request, err error) { } // callGet make a GET request and parse response as a JSON document with given model. -func callGet[T BaseResponse[V], V any](b Bilibili, url string) (resp T, err error) { +func callGet[T types.BaseResponse[V], V any](b Bilibili, url string) (resp T, err error) { req, err := b.newGet(url) if err != nil { b.logger.Error("Cannot create HTTP request instance on API %v: %v", url, err) -- cgit v1.2.3