Original post on stackoverflow:
Code for reproducing the problem:
https://go.dev/play/p/7Xzx1Aauzhh
go version go1.19 darwin/amd64
go tool pprof http://localhost:6060/debug/pprof/heap
func1 is leaking
https://i.stack.imgur.com/LTXHn.png
Is there any reason for this leaking?
Thank you for any input