Hacker News new | ask | show | jobs
by kjksf 2224 days ago
A channel can be used as future / promise but that's not what it is and that's not how it's used by majority of Go programs.

Channel is what it says it is: a way to send data between goroutines.

Also, Go works just fine for UI code, out of the box. See https://github.com/lxn/walk for one of many examples.

You just lock main goroutine with runtime.LockOSThread() to its thread and that's your UI thread and marshall code that touches UI to UI thread. Which is the same thing you must do in C# (or any other language). See https://github.com/golang/go/wiki/LockOSThread