Go also wants to be minified.
$ brew install koki-develop/tap/mingo
$ go install github.com/koki-develop/mingo@latest
Download the binary from the releases page.
$ mingo --help
Go language also wants to be minified.
Usage:
mingo [flags] [files]...
Flags:
-h, --help help for mingo
-v, --version version for mingo
-w, --write write result to (source) file instead of stdout
// main.go
package main
import "fmt"
func fib(n int) int {
if n <= 1 {
return n
}
return fib(n-1) + fib(n-2)
}
func main() {
n := 10
for i := 0; i < n; i++ {
fmt.Println(fib(i))
}
}
$ mingo main.go
package main;import "fmt";func fib(n int)int{if n<=1{return n};return fib(n-1)+fib(n-2)};func main(){n:=10;for i:=0;i<n;i++{fmt.Println(fib(i))}};
An example of minifying cLive: