]> Cypherpunks.ru repositories - gostls13.git/commit
reflect: panic on recv channel close
authorMauri de Souza Meneguzzo <mauri870@gmail.com>
Thu, 20 Jul 2023 23:14:03 +0000 (23:14 +0000)
committerGopher Robot <gobot@golang.org>
Fri, 21 Jul 2023 05:39:00 +0000 (05:39 +0000)
commitf2d709b76925696396441274afbc1d178555a8e6
tree05abadf0201b8444342d4883614f9997ed9f7356
parentb104a0ef32e1388dbd6af7174975857320fb8e80
reflect: panic on recv channel close

It is possible to call reflect.ValueOf(ch).Close() on a recv-only channel,
 while close(ch) is a compile-time error. Following the same reflect
semantics as send and recv this should result in a panic.

Fixes #61445

Change-Id: I2a9ee8f45963593a37bd6df4643dd64fb322f9f9
GitHub-Last-Rev: fe2d5e09f5bb5536ac25d1606cf3744fb7a0a4a9
GitHub-Pull-Request: golang/go#61453
Reviewed-on: https://go-review.googlesource.com/c/go/+/511295
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/reflect/all_test.go
src/reflect/value.go