/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

livesys.se
| | www.4async.com
3.1 parsecs away

Travel
| | Go?1.17?1.17?1.18?6?Go 1.18?1.17? ?Go?interface{}?Go?interface{}? ?Go?...
| | hjr265.me
2.1 parsecs away

Travel
| | 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.
| | mfbmina.dev
2.5 parsecs away

Travel
| | One of the best Go features is how easy we can use concurrency. The language gives us goroutines, which are like lightweight threads managed by the Go runtime. It help us to run several functions at the same instant and is very helpful if you wish to improve the performance of your application. Using this feature is easy as adding the go keyword before any function call. This will make the function run concurrently. To make it simpler, let's show you the code. Here I've written the SleepSort algorithm, w...
| | jbrandhorst.com
24.1 parsecs away

Travel
| Create the protobuf interface We'll start by creating a folder for the package we want to create. Lets call it server. Next we type up a .proto file to define the interface between the server and the client. We'll have to include some extra proto annotations in order to have the gRPC-gateway generate the translations methods we need. Lets define a simple service with a single HTTP GET endpoint: service MyServer { rpc Simple(google.