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

[chore][receiver/aerospike] addressing lint issues #22855

Merged
merged 1 commit into from
May 29, 2023

Conversation

codeboten
Copy link
Contributor

Updating golangci-lint raises the following warnings:

integration_test.go:385:2: if-return: redundant if ...; err != nil check, just return error instead. (revive)
        if err := recordsWaitAndCheck(func() (recordsCheckable, as.Error) {
                return c.Query(queryPolicy, geoStm1)
        }); err != nil {
                return err
        }
integration_test.go:145:2: empty-block: this block is empty, you can remove it (revive)
        for range chk.Results() {
        }
scraper.go:112:36: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func (r *aerospikeReceiver) scrape(ctx context.Context) (pmetric.Metrics, error) {
                                   ^
config.go:54:72: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
                return multierr.Append(allErrs, fmt.Errorf("%w: %s", errBadEndpoint, err))
                                                                                     ^
config.go:63:71: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
                allErrs = multierr.Append(allErrs, fmt.Errorf("%w: %s", errBadPort, err))
                                                                                    ^
config.go:84:78: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
                        allErrs = multierr.Append(allErrs, fmt.Errorf("%w: %s", errFailedTLSLoad, err))

Linked issue: #20424

Updating golangci-lint raises the following warnings:

```
integration_test.go:385:2: if-return: redundant if ...; err != nil check, just return error instead. (revive)
        if err := recordsWaitAndCheck(func() (recordsCheckable, as.Error) {
                return c.Query(queryPolicy, geoStm1)
        }); err != nil {
                return err
        }
integration_test.go:145:2: empty-block: this block is empty, you can remove it (revive)
        for range chk.Results() {
        }
scraper.go:112:36: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func (r *aerospikeReceiver) scrape(ctx context.Context) (pmetric.Metrics, error) {
                                   ^
config.go:54:72: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
                return multierr.Append(allErrs, fmt.Errorf("%w: %s", errBadEndpoint, err))
                                                                                     ^
config.go:63:71: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
                allErrs = multierr.Append(allErrs, fmt.Errorf("%w: %s", errBadPort, err))
                                                                                    ^
config.go:84:78: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
                        allErrs = multierr.Append(allErrs, fmt.Errorf("%w: %s", errFailedTLSLoad, err))
```

Linked issue: open-telemetry#20424

Signed-off-by: Alex Boten <aboten@lightstep.com>
@codeboten codeboten merged commit df11374 into open-telemetry:main May 29, 2023
@codeboten codeboten deleted the codeboten/20424-aerospike branch May 29, 2023 16:05
@github-actions github-actions bot added this to the next release milestone May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants