Hacker News new | ask | show | jobs
by moondev 1222 days ago
Another gem from the same repo - gosh - pure golang shell

This means anywhere golang is installed, including aarch64 Darwin and Windows you can:

      go run mvdan.cc/sh/v3/cmd/gosh@latest

Or things like

      go run mvdan.cc/sh/v3/cmd/gosh@latest -c 'echo "cross platform shell"; go run github.com/mikefarah/yq/v3@latest r metadata.name <(kubectl get pod my-pod -o yaml)'

Pretty awesome stuff, I'm always discovering new ways to use it.
1 comments

At a previous job, my team slowly built an absolutely unmanageable bash script (hundreds of lines, including _many_ complex, multi-line jq incantations). The first step in migrating that script to go was to embed it in a Go binary and run it with gosh.

Kudos to Daniel for building such a wonderful package.