Fix a bunch of not-checking-error lints
This commit is contained in:
parent
114aec73ed
commit
5f3fcc2b3e
14 changed files with 124 additions and 34 deletions
|
|
@ -4,6 +4,8 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/Gleipnir-Technology/nidus-sync/lint"
|
||||
)
|
||||
|
||||
// DraftRequest represents the request body for creating a draft
|
||||
|
|
@ -94,7 +96,7 @@ func (c *Client) CreateDraft(taskID int, draft *DraftRequest) (*Draft, error) {
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to POST %s: %w", path, err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
defer lint.LogOnErr(resp.Body.Close, "close response body")
|
||||
|
||||
// Parse response
|
||||
var createdDraft Draft
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package labelstudio
|
|||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/Gleipnir-Technology/nidus-sync/lint"
|
||||
)
|
||||
|
||||
type TaskResultValue struct {
|
||||
|
|
@ -171,7 +173,7 @@ func (c *Client) TaskUpdate(taskID int, update *TaskUpdate) (*Task, error) {
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to PATCH %s: %w", path, err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
defer lint.LogOnErr(resp.Body.Close, "close response")
|
||||
|
||||
// Parse response
|
||||
var updatedTask Task
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/Gleipnir-Technology/nidus-sync/lint"
|
||||
)
|
||||
|
||||
// User represents a user in Label Studio
|
||||
|
|
@ -33,7 +35,7 @@ func (c *Client) ListUsers() ([]User, error) {
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to GET /api/userls: %w", err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
defer lint.LogOnErr(resp.Body.Close, "close response")
|
||||
|
||||
// Parse response
|
||||
var users []User
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue