Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Linters in Cassandra, Clickhouse & Opentsdb #1252

Open
wants to merge 17 commits into
base: development
Choose a base branch
from

Conversation

coolwednesday
Copy link
Contributor

@coolwednesday coolwednesday commented Nov 28, 2024

Description:

Checklist:

  • I have formatted my code using goimport and golangci-lint.
  • All new code is covered by unit tests.
  • This PR does not decrease the overall code coverage.
  • I have reviewed the code comments and documentation for clarity.

Thank you for your contribution!

pkg/gofr/datasource/opentsdb/opentsdb.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/opentsdb/preprocess.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/opentsdb/response.go Outdated Show resolved Hide resolved
Copy link
Contributor

@ccoVeille ccoVeille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good refactoring 👍

Some minor remarks

pkg/gofr/datasource/opentsdb/opentsdb_test.go Show resolved Hide resolved
pkg/gofr/datasource/opentsdb/opentsdb_test.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/opentsdb/preprocess.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/opentsdb/response.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/opentsdb/opentsdb.go Show resolved Hide resolved
Copy link
Contributor

@ccoVeille ccoVeille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may think I'm against these changes 😅

But, I'm not 😁

pkg/gofr/datasource/opentsdb/interface.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/opentsdb/interface.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/opentsdb/opentsdb_test.go Show resolved Hide resolved
pkg/gofr/datasource/opentsdb/opentsdb.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/opentsdb/opentsdb.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/opentsdb/opentsdb_test.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/opentsdb/opentsdb_test.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/opentsdb/opentsdb_test.go Show resolved Hide resolved
pkg/gofr/datasource/opentsdb/opentsdb_test.go Outdated Show resolved Hide resolved
pkg/gofr/datasource/opentsdb/response.go Outdated Show resolved Hide resolved
Umang01-hash
Umang01-hash previously approved these changes Dec 4, 2024
@@ -181,8 +183,7 @@ func TestPutInvalidDataPoint(t *testing.T) {
resp := &PutResponse{}

err := client.PutDataPoints(context.Background(), dataPoints, "", resp)
require.Error(t, err)
require.Equal(t, "the value of the given datapoint is invalid", err.Error())
require.EqualError(t, err, "invalid data points: please give a valid value")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this

Suggested change
require.EqualError(t, err, "invalid data points: please give a valid value")
require.ErrotIs(t, err, errInvalidDataPoint)
require.ErrorContains(t, err, "please give a valid value")

@@ -226,8 +226,7 @@ func TestPutErrorResponse(t *testing.T) {
resp := &PutResponse{}

err := client.PutDataPoints(context.Background(), dataPoints, "", resp)
require.Error(t, err)
require.Equal(t, "client error: 400", err.Error())
require.EqualError(t, err, "error response from OpenTSDB server, status code: 400")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can test errResp here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants