Skip to content

Instantly share code, notes, and snippets.

View arbel03's full-sized avatar
🤖
robomonkey.io

Arbel I. arbel03

🤖
robomonkey.io
View GitHub Profile
@icecrime
icecrime / gist:67399480c9a10b48fadc
Last active November 7, 2023 08:38
An experiment with Golang reflection and channels
package main
import (
"reflect"
"strings"
)
func makeChannel(t reflect.Type, chanDir reflect.ChanDir, buffer int) reflect.Value {
ctype := reflect.ChanOf(chanDir, t)
return reflect.MakeChan(ctype, buffer)