Every time I consider replacing the Node command line tool with something more compact, I run into some strange problem no one warned me about. Are there any hidden pitfalls I should identify before deciding to completely rewrite the code?
Hidden catches with replacing Node-based CLI tools with Go code
I recently did exactly this for an internal build pipeline; it took about six weeks. The first hurdle was signal propagation: SIGTERM simply disappeared into the child process tree. Overall, what surprised me most was how differently terminal width detection works without a proper PTY layer.
When rewriting a command-line tool that previously used Node streams, the most difficult hidden problem is usually pseudo-terminal emulation, as Go handles raw TTY data differently and libraries vary in maturity. Any Go developer working in this area should test resize events specifically in the tmux environment, as this environment masks bugs that manifest in regular terminals. The code for SIGWINCH is rarely unit-tested. For a structural reference, consider the project Gopher Code https://github.com/projectbarks/gopher-code