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

Detect appending to a variadic argument

Open dfawley opened this issue 2 years ago • 0 comments

Please see https://go.dev/play/p/-ex0P0JLOV0 to demonstrate how modifying the variadic argument of a function can alter the memory of the caller. It's unlikely a caller of a function like this would expect this behavior, and it's unlikely the author of the function actually intends to cause this side effect, so it would be nice to have a checker that warns on this case.

dfawley avatar Feb 16 '23 22:02 dfawley