//! # go
//!
//! A runtime-agnostic Go-style concurrency library for Rust.
//!
//! Select your async runtime at compile time via Cargo features:
//!
//! ```toml
//! [dependencies]
//! go = { version = "0.1", features = ["rt-tokio"] }   # or rt-async-std, rt-smol
//! ```
//!
//! ## Primitives
//!
//! - [`spawn`] / [`go!`] — fire-and-forget async task spawn
//! - [`chan`] — bounded and unbounded channels
//! - [`select!`] — multiplex channel recv operations
//! - [`WaitGroup`] — wait for a group of tasks to complete
//! - [`sleep`] / [`timeout`] — async timers
//! - [`singleflight::Group`] — deduplicate concurrent calls by key

#[cfg(not(any(feature = "rt-tokio", feature = "rt-async-std", feature = "rt-smol")))]
compile_error!(
    "go: exactly one runtime feature must be enabled (rt-tokio, rt-async-std, or rt-smol)"
);

#[cfg(any(
    all(feature = "rt-tokio", feature = "rt-async-std"),
    all(feature = "rt-tokio", feature = "rt-smol"),
    all(feature = "rt-async-std", feature = "rt-smol"),
))]
compile_error!("go: exactly one runtime feature must be enabled — multiple selected");

mod backend;
pub mod chan;
mod select;
pub mod singleflight;
mod spawn;
mod time;
mod waitgroup;

pub use spawn::{JoinError, JoinHandle, spawn};
pub use time::{Elapsed, sleep, timeout};
pub use waitgroup::{WaitGroup, WaitGroupGuard};
