Can I import a Golang package based on the OS I'm building for?
问题 Say I have a go project that based on which OS, and in some cases which distro, I want to use say a Systemd client package vs an Upstart client package vs a sysv client package vs a launchd client package. Is it possible to selectively import each package so I only import the one I need per OS/distro I'm building for? Or do I have to import each package for each OS/distro? 回答1: Package build Build Constraints A build constraint, also known as a build tag, is a line comment that begins //