Question about this code . why variables escape to heap
func main() {
port := "8080"
host := "localhost:"
connection := host + port
fmt.Println(connection)
}
gorun -gcflags "-m -l" main.go
# command-line-arguments
./main.go:12:21: host + port escapes to heap
./main.go:13:13: ... argument does not escape
./main.go:13:13: connection escapes to heap
And I found if use fmt.Sprintf
it also cause the variables escape to heap