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

Fix some errcheck errors #2881

Merged
merged 9 commits into from
May 14, 2021
Merged

Conversation

mx-psi
Copy link
Member

@mx-psi mx-psi commented Apr 2, 2021

Description:

  • Solve some errcheck linter errors in a non-breaking way.

Link to tracking issue: Updates #2789

To be tracked on #2819.

@codecov
Copy link

codecov bot commented Apr 2, 2021

Codecov Report

Merging #2881 (0e2c492) into main (90b2dec) will decrease coverage by 0.01%.
The diff coverage is 54.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2881      +/-   ##
==========================================
- Coverage   91.58%   91.57%   -0.02%     
==========================================
  Files         312      312              
  Lines       15351    15352       +1     
==========================================
- Hits        14059    14058       -1     
- Misses        883      884       +1     
- Partials      409      410       +1     
Impacted Files Coverage Δ
...scraper/processesscraper/processes_scraper_unix.go 88.88% <0.00%> (-11.12%) ⬇️
service/zpages.go 0.00% <0.00%> (ø)
component/componenttest/shutdown_verifier.go 78.94% <100.00%> (ø)
exporter/otlphttpexporter/otlp.go 83.52% <100.00%> (ø)
processor/processorhelper/hasher.go 100.00% <100.00%> (ø)
receiver/kafkareceiver/kafka_receiver.go 100.00% <100.00%> (ø)
receiver/otlpreceiver/otlphttp.go 76.92% <100.00%> (ø)
receiver/zipkinreceiver/trace_receiver.go 90.47% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 90b2dec...0e2c492. Read the comment docs.

@mx-psi
Copy link
Member Author

mx-psi commented Apr 2, 2021

Not sure why testbed tests are failing, keeping as draft until I figure it out

@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@mx-psi mx-psi marked this pull request as ready for review April 15, 2021 11:04
@mx-psi mx-psi requested a review from a team April 15, 2021 11:04
@mx-psi
Copy link
Member Author

mx-psi commented Apr 16, 2021

So this fixes all errcheck errors in non-test code that are not in obsreport or are excluded by golangci-lint by default. For obsreport I had #2882 but given that there are going to be some changes I am going to leave it be.

I will open a separate PR for fixing test code errchecks (which it's lower priority since it will not cause any breaking changes).

@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Apr 28, 2021
@mx-psi
Copy link
Member Author

mx-psi commented Apr 28, 2021

@bogdandrutu Can you reply to the comment above whenever you find the time? thanks!

@github-actions github-actions bot removed the Stale label Apr 29, 2021
var err error
err = os.MkdirAll(resultsDir, os.FileMode(0755))
if err != nil {
log.Fatalf(err.Error())
Copy link
Member

Choose a reason for hiding this comment

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

Just log.Fatal(err)? And everywhere.

Also to avoid var shading, better to write:

if err := os.MkdirAll(resultsDir, os.FileMode(0755)); err != nil {
	log.Fatal(err)
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@alolita
Copy link
Member

alolita commented May 12, 2021

@bogdandrutu why is this PR pending? Can it be merged :-)

@bogdandrutu bogdandrutu merged commit 29b576e into open-telemetry:main May 14, 2021
Frefreak pushed a commit to Frefreak/opentelemetry-collector that referenced this pull request May 15, 2021
* Check testbed errors

* Check some more errors

* Empty commit to retrigger CI

* Address comments on hostmetricsreceiver

* Rewrite some errchecking code

* Inline ifs

* Inline ifs and change log.Fatalf + Error() calls by log.Fatal
@mx-psi mx-psi deleted the mx-psi/errcheck branch May 15, 2021 22:14
dashpole pushed a commit to dashpole/opentelemetry-collector that referenced this pull request Jun 14, 2021
* Check testbed errors

* Check some more errors

* Empty commit to retrigger CI

* Address comments on hostmetricsreceiver

* Rewrite some errchecking code

* Inline ifs

* Inline ifs and change log.Fatalf + Error() calls by log.Fatal
ankitnayan pushed a commit to SigNoz/opentelemetry-collector that referenced this pull request Jul 27, 2021
* Check testbed errors

* Check some more errors

* Empty commit to retrigger CI

* Address comments on hostmetricsreceiver

* Rewrite some errchecking code

* Inline ifs

* Inline ifs and change log.Fatalf + Error() calls by log.Fatal
@mx-psi mx-psi mentioned this pull request Nov 19, 2021
hughesjj pushed a commit to hughesjj/opentelemetry-collector that referenced this pull request Apr 27, 2023
…pen-telemetry#2881)

Bumps [k8s.io/client-go](https://github.com/kubernetes/client-go) from 0.25.3 to 0.26.3.
- [Release notes](https://github.com/kubernetes/client-go/releases)
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md)
- [Commits](kubernetes/client-go@v0.25.3...v0.26.3)

---
updated-dependencies:
- dependency-name: k8s.io/client-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.

3 participants