fix to be able to compile on Windows #13
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By default, code like this won't compile on Windows because of some missing definitions in Windows:
This change will use empty functions for Windows and will allow it to compile on Windows when creating cross-platform apps that use go-daemon on Linux, and don't use it for Windows. This change won't affect compilation on Linux in any way. I think go-daemon should follow the standard Golang naming convention which is used by Google:
For example:
your_package_linux.go
your_package_darwin.go
your_package_windows.go
You could see how it is implemented in standard os/signal package for example: https://github.com/golang/go/tree/master/src/os/signal
your_package_posix.go is not following this convention and gets picked up and compiled on Windows, which is wrong.