Today I learned about...
go

← All tags

TILs

TypeScript’s compiler is being reimagined. Currently at version 5.8, TypeScript is still written in TypeScript itself, but there are plans to port it to Go for version 7.

This change promises to improve compilation times—by up to 10 times faster! True, the speed boost is something we probably won’t see for a few months or years, but I’m super excited to see Go get some much needed love and attention, since you know, it’s my secondary language of choice.

TIL that golang allows for empty switch statements in the condition block. This is not possible in JavaScript! The reasoning behind this is that the switch statement in golang is not limited to only comparing values. Below you can see two versions of branching logic — one with the switch and one with else ifs 😊.

with-switch.go
package main
import "fmt"
func main() {
    i := 10
    switch {
    case i < 0:
        fmt.Println("Negative number")
    case i == 0:
        fmt.Println("Zero")
    case i > 0:
        fmt.Println("Positive number")
    }
}
no-switch.go
package main
import "fmt"
func main() {
    i := 10
    if i < 0 {
        fmt.Println("Negative number")
    } else if i == 0 {
        fmt.Println("Zero")
    } else if i > 0 {
        fmt.Println("Positive number")
    }
}
go12.04.2023

wails.io

At a recent go meetup, I learned about a a cool thing to create cross platform applications in Go: wails.

Check it out

While working through my golang course, I came across a tool for live-reloading golang apps: Air

Check it out

Blog posts