If you name your file lib_linux.go, all the content in that file will only be compiled in linux environments:
lib_linux.go
package lib var OnlyCompiledInLinux string