bodyclose icon indicating copy to clipboard operation
bodyclose copied to clipboard

SSA and generics (go1.18)

Open ldez opened this issue 3 years ago • 4 comments

Currently, SSA is not working with generics.

So your linter produces a panic when it is used with generics.

There is an issue open about that in the Go repository: https://github.com/golang/go/issues/48525

Inside golangci-lint, we have disabled your linters: https://github.com/golangci/golangci-lint/issues/2649

You have 2 solutions:

  • waiting for a version of SSA that will support generics
  • dropping the SSA analyzers and using something else to analyze the code.

Related to https://github.com/golang/go/issues/50558

ldez avatar Mar 24 '22 13:03 ldez

SSA has been updated and it seems to work inside golangci-lint.

ldez avatar Jul 19 '22 00:07 ldez

in fact the problem is still here

ldez avatar Jul 19 '22 11:07 ldez

I did some more extensive testing and the issue seems to be resolved.

ldez avatar Jul 19 '22 22:07 ldez

https://github.com/golangci/golangci-lint/issues/3086

ldez avatar Aug 15 '22 20:08 ldez

PR #41 fixes this, tested with the case in https://github.com/golangci/golangci-lint/issues/3086

~/chconn$ go vet -vettool=$(which bodyclose) ./...
~/chconn$

Yes that's no output all good :)

stevenh avatar Nov 04 '22 23:11 stevenh