You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
proposal: add static analysis to find deprecated reflect.{SliceHeader,StringHeader} that could be replaced by unsafe.{Slice,SliceData,String,StringData}
#54989
Closed
cuiweixie opened this issue
Sep 10, 2022
· 5 comments
when proposal is done, the reflect.{SliceHeader,StringHeader} will be deprecated.
I think we can add static check for our user to find the deprecated code that can be replace by unsafe.{Slice,SliceData,String,StringData}
The text was updated successfully, but these errors were encountered:
Note that staticcheck already has check SA1019 for functions which are marked as deprecated in the doc comment. Once reflect.{Slice,String}Header have such a comment, staticcheck should automatically flag their usage as deprecated. Thus, I don't think a dedicated static checker is needed.
It should be the case that all uses of reflect.SliceHeader and StringHeader can be replaced, so the analysis is trivial.
Also, vet does not in general report "Deprecated" uses, although other tools do, including gopls I believe. We should probably just rely on those other tools.
This proposal has been added to the active column of the proposals project
and will now be reviewed at the weekly proposal review meetings.
— rsc for the proposal review group
when proposal is done, the reflect.{SliceHeader,StringHeader} will be deprecated.
I think we can add static check for our user to find the deprecated code that can be replace by unsafe.{Slice,SliceData,String,StringData}
The text was updated successfully, but these errors were encountered: