aboutsummaryrefslogtreecommitdiff
path: root/src/text/template/exec.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/text/template/exec.go')
-rw-r--r--src/text/template/exec.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/text/template/exec.go b/src/text/template/exec.go
index 7ac5175006..19154fc640 100644
--- a/src/text/template/exec.go
+++ b/src/text/template/exec.go
@@ -373,6 +373,10 @@ func (s *state) walkRange(dot reflect.Value, r *parse.RangeNode) {
if val.IsNil() {
break
}
+ if val.Type().ChanDir() == reflect.SendDir {
+ s.errorf("range over send-only channel %v", val)
+ break
+ }
i := 0
for ; ; i++ {
elem, ok := val.Recv()