Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-codefresh committed Dec 15, 2024
1 parent 4d922ea commit 1358037
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/sources_server_client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ func (c *sourceServerClient) sendRequest(method, url string, payload interface{}
if payload != nil {
requestBody, err = json.Marshal(payload)
if err != nil {
return nil, fmt.Errorf("error marshalling payload: %v", err)
return nil, fmt.Errorf("error marshalling payload: %w", err)
}
}

req, err := http.NewRequest(method, fmt.Sprintf("%s%s", c.clientConfig.BaseURL, url), bytes.NewBuffer(requestBody))
if err != nil {
return nil, fmt.Errorf("error creating request: %v", err)
return nil, fmt.Errorf("error creating request: %w", err)
}

req.Header.Set("Content-Type", "application/json")

client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
return nil, fmt.Errorf("error making request: %v", err)
return nil, fmt.Errorf("error making request: %w", err)
}
defer resp.Body.Close()

Expand All @@ -64,7 +64,7 @@ func (c *sourceServerClient) sendRequest(method, url string, payload interface{}

body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("error reading response body: %v", err)
return nil, fmt.Errorf("error reading response body: %w", err)
}

return body, nil
Expand All @@ -73,14 +73,14 @@ func (c *sourceServerClient) sendRequest(method, url string, payload interface{}
func (c *sourceServerClient) GetAppVersion(app *v1alpha1.Application) *AppVersionResult {
appVersionResult, err := c.sendRequest("POST", "/getAppVersion", app)
if err != nil {
log.Errorf("error getting app version: %v", err)
log.Errorf("error getting app version: %w", err)

Check failure on line 76 in pkg/sources_server_client/client.go

View workflow job for this annotation

GitHub Actions / Lint Go code

printf: github.com/sirupsen/logrus.Errorf does not support error-wrapping directive %w (govet)

Check failure on line 76 in pkg/sources_server_client/client.go

View workflow job for this annotation

GitHub Actions / Run unit tests for Go packages

github.com/sirupsen/logrus.Errorf does not support error-wrapping directive %w
return nil
}

var versionStruct AppVersionResult
err = json.Unmarshal(appVersionResult, &versionStruct)
if err != nil {
log.Errorf("error unmarshaling app version: %v", err)
log.Errorf("error unmarshaling app version: %w", err)

Check failure on line 83 in pkg/sources_server_client/client.go

View workflow job for this annotation

GitHub Actions / Lint Go code

printf: github.com/sirupsen/logrus.Errorf does not support error-wrapping directive %w (govet)

Check failure on line 83 in pkg/sources_server_client/client.go

View workflow job for this annotation

GitHub Actions / Run unit tests for Go packages

github.com/sirupsen/logrus.Errorf does not support error-wrapping directive %w
return nil
}

Expand Down

0 comments on commit 1358037

Please sign in to comment.