| I just rewrote a tangled 500 line shell script in go. It was my first time writing a golang project at work, so I'm sure it could have been better. But writing it the naive way, with all the required golang error handling, it ended up taking about 10x more lines of code in golang than the original bash script. It does have a dramatically better UX (largely thanks to spf13's cobra and viper), and is way faster than the original, and the codebase is a lot cleaner and more maintainable. So I think it was worthwhile for the users and maintainers. But still, 10x more lines of code. I like the OP, but I'm still not sure I would reach for golang for short shell scripts. |