mirror of
https://github.com/gofiber/storage.git
synced 2025-10-22 00:01:53 +08:00
fix tests
This commit is contained in:
@@ -68,7 +68,12 @@ func (t *TestModule) GetWorkersKV(ctx context.Context, rc *cloudflare.ResourceCo
|
||||
return nil, err
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
defer func() {
|
||||
err := resp.Body.Close()
|
||||
if err != nil {
|
||||
log.Println("Error closing response body:", err)
|
||||
}
|
||||
}()
|
||||
|
||||
respBody, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
@@ -111,7 +116,12 @@ func (t *TestModule) WriteWorkersKVEntry(ctx context.Context, rc *cloudflare.Res
|
||||
return cloudflare.Response{}, err
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
defer func() {
|
||||
err := resp.Body.Close()
|
||||
if err != nil {
|
||||
log.Println("Error closing response body:", err)
|
||||
}
|
||||
}()
|
||||
|
||||
return cloudflare.Response{
|
||||
Success: true,
|
||||
@@ -148,7 +158,12 @@ func (t *TestModule) DeleteWorkersKVEntry(ctx context.Context, rc *cloudflare.Re
|
||||
return cloudflare.Response{}, err
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
defer func() {
|
||||
err := resp.Body.Close()
|
||||
if err != nil {
|
||||
log.Println("Error closing response body:", err)
|
||||
}
|
||||
}()
|
||||
|
||||
return cloudflare.Response{
|
||||
Success: true,
|
||||
@@ -189,7 +204,12 @@ func (t *TestModule) ListWorkersKVKeys(ctx context.Context, rc *cloudflare.Resou
|
||||
return cloudflare.ListStorageKeysResponse{}, err
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
defer func() {
|
||||
err := resp.Body.Close()
|
||||
if err != nil {
|
||||
log.Println("Error closing response body:", err)
|
||||
}
|
||||
}()
|
||||
|
||||
result := []cloudflare.StorageKey{}
|
||||
|
||||
|
Reference in New Issue
Block a user