summaryrefslogtreecommitdiff
path: root/bilibili/request.go
diff options
context:
space:
mode:
authorKeuin <[email protected]>2023-07-11 22:56:07 +0800
committerKeuin <[email protected]>2023-07-11 22:56:07 +0800
commitf5c63cde56eb35c0125a0545f084441cdd4340ab (patch)
treecf24779daaa3067902bef91d21bcdee7a78fd059 /bilibili/request.go
parent7fd817f6d1ead3de85294c1893a6e1572a1d12e3 (diff)
Refactor: move data structures to a separate package to avoid circular dependency.
Diffstat (limited to 'bilibili/request.go')
-rw-r--r--bilibili/request.go3
1 files changed, 2 insertions, 1 deletions
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)