3 ms·
My team all use macOS, so it was really easy for me to write a CLI in Go (this library [1] is great), and then run go install to create a full-contained bin
by tylerpachal 10y ago
My team all use macOS, so it was really easy for me to write a CLI in Go (this library [1] is great), and then run
go install
to create a full-contained binary that I could distribute to everyone. People can put the binary somewhere on their PATH, for example: `/usr/local/bin`, and then be able to run it like any other shell command.
If you already have python installed then it isn't too much trouble to run a .py file by doing
python mycli.py
But if you have a bin on your PATH you could just run
mycli
without having to install Go or any of the dependancies because they're bundled up in the binary.
edit: I should add that it is possible to cross-compile with Go, so if someone on my team wasn't on the same OS as me I could support them as well
[1] https://github.com/urfave/cli https://github.com/urfave/cli