I am writing a command line utility in Go so that (as part of its work) I need to get the password from the user. There is a great gopass module for Unix there, and I know how to write it for the Windows console. The problem is that the Windows module will obviously not be built on * nix, and the * nix version will not be built on Windows. Since Go does not have support in the preprocessor (as far as I can tell), I absolutely do not know how to approach this correctly. I know this is possible, since Go itself should do this for its own libraries, but the tool I'm used to (conditional import / preprocessors / etc.) Seems to be missing.
source share