/explore

Click through on any links that interest you or select the planets on the right to continue exploring the Outer Web.
You are here

blog.nuculabs.de
| | hjr265.me

I have been meaning to do a few short-form blog posts lately. This blog post is going to be one of them. In Go, on Linux, if you want to know when the terminal window is resized, you can listen for the SIGWINCH signal using the signal.Notify (or the signal.NotifyContext) function. The code will look something like this: 1 2 3 4 5 ch := make(chan os.Signal) signal.Notify(ch, syscall.SIGWINCH) for range ch { // The terminal has been resized.
2.4 parsecs

Travel
| |
| | infinitedigits.co

Exploring meta-behaviors.
3.3 parsecs

Travel
| |
| | www.integralist.co.uk

The following code doesn't do what you might expect: package main import "fmt" func main() { var i *impl fmt.Println("i == nil:", i == nil) what(i) } type impl struct{} func (i *impl) do() {} func what(i interface{ do() }) { fmt.Println("i == nil:", i == nil) } If you expected the what function to print i == nil: true, then keep reading... Typed Nils The behavior observed is due to the way interfaces and nil values interact in Go.
3.2 parsecs

Travel
| |
| | lewisdale.dev

Now it's time to actually try and send a "ping" to a website
31.4 parsecs

Travel
|