// internal/pipeline/pipeline.go
package pipeline

import "sync"

// Run starts a background worker it is supposed to wait for. On the early
// return it skips wg.Wait(), abandoning the goroutine.
func Run(fail bool) {
	var wg sync.WaitGroup
	wg.Add(1)
	go func() {
		defer wg.Done()
		work()
	}()
	if fail {
		return // returns without wg.Wait(): the goroutine is abandoned
	}
	wg.Wait()
}

func work() {}
