reflect: stub channel select routines/types

This commit is contained in:
Damian Gryski
2023-03-24 09:36:41 -07:00
committed by Ron Evans
parent 3fbd3c4d93
commit 1a60a1f526
+27
View File
@@ -1753,6 +1753,33 @@ func MakeMapWithSize(typ Type, n int) Value {
}
}
type SelectDir int
const (
_ SelectDir = iota
SelectSend // case Chan <- Send
SelectRecv // case <-Chan:
SelectDefault // default
)
type SelectCase struct {
Dir SelectDir // direction of case
Chan Value // channel to use (for send or receive)
Send Value // value to send (for send)
}
func Select(cases []SelectCase) (chosen int, recv Value, recvOK bool) {
panic("unimplemented: reflect.Select")
}
func (v Value) Send(x Value) {
panic("unimplemented: reflect.Value.Send()")
}
func (v Value) Close() {
panic("unimplemented: reflect.Value.Close()")
}
// MakeMap creates a new map with the specified type.
func MakeMap(typ Type) Value {
return MakeMapWithSize(typ, 8)