I think you’re oversimplifying and don’t know if you know about the unsafe package, which can be similar to the offset point of C (this is just an example), and simply reclaiming memory will cause unexpected problems.
s -> s[0] -> a
s[1]
// s=s[1:]
s[0] -> a
s -> s[1]
When you use s, you’re actually referencing the entire underlying array, and GC doesn’t recycle the memory of the underlying array. At the same time, because the underlying array references the memory that A points to, the memory of A will not gc.
The memory pointed to by a will only be freed if there is no reference to the underlying array in your context. It’s not hard to see why.
As for why GC doesn’t handle this kind of thing for you, I think you’re putting the cart before the horse: the ease of use of Golang doesn’t mean it stops you from writing bad code at will.
Awareness of memory allocation is a basic quality for developers (I admit that golang is easy to get started with, but I’ve encountered a lot of developers who write bad code).