Package dag implements a directed acyclic graph task runner with deterministic teardown, similar to errgroup.