Skip to content

Instantly share code, notes, and snippets.

@justinmoon
Created April 24, 2020 05:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinmoon/88e8108d047f5c74b666b01a42445a6e to your computer and use it in GitHub Desktop.
Save justinmoon/88e8108d047f5c74b666b01a42445a6e to your computer and use it in GitHub Desktop.
#[cfg(all(target_os = "linux"))]
fn are_you_on_linux() {
println!("You are running linux!");
}
#[cfg(not(target_os = "linux"))]
fn are_you_on_linux() {
println!("You are *not* running linux!");
}
fn main() {
are_you_on_linux();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment