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 bost
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 😊.
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")
}
}
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")
}
}
While working through my golang course, I came across a tool for live-reloading
golang apps: Air