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

Error return value of `` is not checked #2307

Closed
4 tasks done
mdelah opened this issue Oct 25, 2021 · 1 comment · Fixed by #2309
Closed
4 tasks done

Error return value of `` is not checked #2307

mdelah opened this issue Oct 25, 2021 · 1 comment · Fixed by #2309
Assignees
Labels
bug Something isn't working

Comments

@mdelah
Copy link
Contributor

mdelah commented Oct 25, 2021

Welcome

  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).
  • Yes, I've tried with the standalone linter if available. (https://golangci-lint.run/usage/linters/)

Description of the problem

If errcheck reports a FuncName but no SelectorName, golangci-lint prints the error above.

Version of golangci-lint

v1.42.1

Configuration file

n/a

Go environment

1.17.2

Verbose output of running

$ golangci-lint run -v
INFO [config_reader] Config search paths: [./ /home/miles/repos/test /home/miles/repos /home/miles /home /]
INFO [lintersdb] Active 10 linters: [deadcode errcheck gosimple govet ineffassign staticcheck structcheck typecheck unused varcheck]
INFO [loader] Go packages loading at mode 575 (deps|exports_file|compiled_files|files|imports|name|types_sizes) took 179.2417ms
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 158.6µs
INFO [linters context/goanalysis] analyzers took 0s with no stages
INFO [runner] Processors filtering stat (out/in): max_per_file_from_linter: 1/1, severity-rules: 1/1, path_prefixer: 1/1, sort_results: 1/1, skip_files: 1/1, exclude-rules: 1/1, uniq_by_line: 1/1, max_same_issues: 1/1, path_shortener: 1/1, path_prettifier: 1/1, skip_dirs: 1/1, diff: 1/1, source_code: 1/1, cgo: 1/1, filename_unadjuster: 1/1, identifier_marker: 1/1, max_from_linter: 1/1, autogenerated_exclude: 1/1, exclude: 1/1, nolint: 1/1
INFO [runner] processing took 395.8µs with stages: path_prettifier: 206.3µs, identifier_marker: 69µs, nolint: 42.4µs, autogenerated_exclude: 27.9µs, exclude-rules: 18.1µs, source_code: 11.4µs, skip_dirs: 10.1µs, cgo: 2.2µs, uniq_by_line: 2µs, max_same_issues: 2µs, filename_unadjuster: 1µs, max_from_linter: 900ns, path_shortener: 800ns, skip_files: 400ns, max_per_file_from_linter: 300ns, severity-rules: 300ns, exclude: 200ns, diff: 200ns, sort_results: 200ns, path_prefixer: 100ns
INFO [runner] linters took 15.9209ms with stages: goanalysis_metalinter: 15.3314ms
main.go:7:32: Error return value of `` is not checked (errcheck)
        conn.(*net.TCPConn).SetNoDelay(true)
                                      ^
INFO File cache stats: 1 entries of total size 101B
INFO Memory: 4 samples, avg is 29.7MB, max is 37.1MB
INFO Execution took 238.4137ms

Code example or link to a public repository

package main

import "net"

func main() {
        var conn net.Conn
        conn.(*net.TCPConn).SetNoDelay(true)
}
@mdelah mdelah added the bug Something isn't working label Oct 25, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Oct 25, 2021

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants