Okay. In the meantime i found one solution: Using Build Constraints.See these in action here: https://github.com/trivago/gollum/blob/ab7348416bb3d29aebc15f588c5643667c6e83f4/signal_unix.go#L15Documented here: https://golang.org/pkg/go/build/#hdr-Build_ConstraintsAny other solution?