Skip to content

Error return value of `` is not checked #2307

Closed
@mdelah

Description

@mdelah

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)
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions