Current state of garbage collection for slice

Unfortunately, golang can figure out for itself if the memory needs to be freed. Most of the time, setting nil is the same as not setting nil, depending on your context.
As for static analysis tools, it’s a nice idea, and I would try to use one if it were available, but it’s complicated. If the context is not carefully analyzed, it can be annoying if the consumer is misled to actively set nil on the object being used.
Good luck.