Open bdemetris opened 6 years ago
I've been thinking about this. What you want (most likely) is to use build tags to only compile windows code for exe
and macos code for darwin binaries. Go has a quick shortcut for this. Basically any file that ends with _windows.go
will only compile for windows and _darwin.go
will only compile for mac. That can be used here by having a single function in reports like BuildReport() *Report
which implemented three times in _darwin
, _linux
and _windows.go
.
Also agree about using the build tags. The file name approach is way more common and easier than using the // +windows header syntax.
That case statement might be required later but that’s only helpful for runtime vs buildtime.
need to put a switch in that does something like