go-listener: solve problem with memory alocation