The range init AST execution was skipped, and range could work only over variables or direct function calls. By setting the start node to the start of init and not init itself, we ensure that the init AST is always taken into account. Fixes #775.
19 lines
243 B
Go
19 lines
243 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http/httptest"
|
|
)
|
|
|
|
func main() {
|
|
recorder := httptest.NewRecorder()
|
|
recorder.Header().Add("Foo", "Bar")
|
|
|
|
for key, value := range recorder.Header() {
|
|
fmt.Println(key, value)
|
|
}
|
|
}
|
|
|
|
// Output:
|
|
// Foo [Bar]
|