fix: query params support + remove duplicate response wrappers + fix tests
This commit is contained in:
@@ -18,11 +18,8 @@ func TestClientAuthHeader(t *testing.T) {
|
||||
|
||||
c := newClient(srv.URL, "sk-test")
|
||||
var result struct {
|
||||
Code int `json:"code"`
|
||||
Data struct {
|
||||
ID int `json:"id"`
|
||||
Name string `json:"name"`
|
||||
} `json:"data"`
|
||||
ID int `json:"id"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
if err := c.get(context.Background(), "/test", &result); err != nil {
|
||||
t.Fatalf("get() error: %v", err)
|
||||
@@ -30,8 +27,8 @@ func TestClientAuthHeader(t *testing.T) {
|
||||
if gotKey != "sk-test" {
|
||||
t.Errorf("X-Api-Key = %q, want %q", gotKey, "sk-test")
|
||||
}
|
||||
if result.Data.Name != "test" {
|
||||
t.Errorf("Data.Name = %q, want %q", result.Data.Name, "test")
|
||||
if result.Name != "test" {
|
||||
t.Errorf("Name = %q, want %q", result.Name, "test")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user