go-tools icon indicating copy to clipboard operation
go-tools copied to clipboard

Please include support for zerolog Panic (nil pointer check)

Open eraserix opened this issue 4 years ago • 9 comments

Please add support for zerolog "Panic" to avoid triggering "SA5011: possible nil pointer dereference".

eraserix avatar Jul 02 '20 07:07 eraserix

Hi @dominikh Is there any update on this issue?

dlsrb6342 avatar Feb 11 '22 06:02 dlsrb6342

I think that that was discussed somewhere else, but perhaps a list of fully-qualified identifier names of terminating functions could be added to staticcheck.conf. So that people could update the for their projects' needs instead of teaching staticcheck about all logging and utility libraries.

ainar-g avatar Feb 11 '22 11:02 ainar-g

Please file an issue if we’re missing support for a popular package.

I found this in docs.

https://github.com/dominikh/go-tools/blob/82c7dc98d5026ca37b7f82c981597810cf1c37aa/ir/exits.go#L22-L60 And staticcheck only supports logrus. I think zerolog can be added.

@ainar-g Could you give guide how to add terminating functions to configuration?

dlsrb6342 avatar Feb 14 '22 07:02 dlsrb6342

@dlsrb6342, I cannot provide any guides, since the feature doesn't exist yet. My comment was merely a proposal to add it.

ainar-g avatar Feb 14 '22 08:02 ainar-g