amorey

amorey / gochan

Public

A small library of common channel architectures for Go, inspired by Rust

10
0
100% credibility
Found May 31, 2026 at 10 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Go
AI Summary

Gochan is a Go programming library that provides seven specialized channel types for coordinating concurrent code. While Go's standard channels only offer one basic type, gochan gives developers the right tool for common patterns: one-shot handoffs for single results, work queues for distributing tasks across workers, broadcast channels for event notifications, and latest-value channels for state updates. Each type handles the complex synchronization internally, letting developers focus on their application logic instead of managing concurrent communication.

How It Works

1
💡 You discover a coordination challenge

While building your Go application, you need multiple parts of your code to communicate and coordinate without getting in each other's way.

2
🤔 You realize Go's basic channels are limited

Go's built-in channels work great for simple cases, but you need specialized patterns like broadcasting updates to everyone or collecting results from many workers.

3
📦 You find gochan with seven specialized channel types

This library gives you exactly the right tool for each job: one-shot handoffs, work distribution, event broadcasting, latest-value updates, and more.

4
You pick the channel that fits your needs
👥
Fan-out to many listeners

Use broadcast when one part of your code needs to notify many listeners about events

Distribute work to a pool

Use the work queue when you have many tasks and want multiple workers to share the load

🔄
Track the latest state

Use watch when you only care about the most recent value and don't need every intermediate update

📬
One-time result delivery

Use oneshot when a goroutine returns exactly one result and then is done

5
Your concurrent code works correctly

The library handles all the tricky synchronization details, so your code safely coordinates between parts without data races or lost messages.

🎉 Your application runs smoothly

Your goroutines communicate exactly as intended, whether that's broadcasting events, distributing work, or delivering results.

Sign up to see the full architecture

4 more

Sign Up Free

Star Growth

See how this repo grew from 10 to 10 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is gochan?

Gochan is a Go library that provides seven specialized channel types that Go's standard library doesn't ship with. Out of the box, Go only gives you one channel type (multiple-producer/multiple-consumer), but real-world applications often need patterns like one-shot single-value handoffs, broadcast fan-out to multiple subscribers, or "latest value only" channels for configuration updates. Gochan fills that gap. It includes oneshot channels for single value delivery, various queue flavors (spsc, spmc, mpsc, mpmc), broadcast channels where every subscriber sees every value, and watch channels that only keep the most recent value. All channel types implement common Sender and Receiver interfaces, so you can swap architectures without changing call sites.

Why is it gaining traction?

The Rust community has long had specialized channel types in the standard library, and Go developers have been building similar patterns by hand repeatedly. Gochan codifies those patterns with consistent APIs and proper semantics around closing and cancellation. Every type supports TrySend, TryRecv, and context-aware operations out of the box. The 100% test coverage signals the library takes correctness seriously, especially around close races and concurrent access. The API design is pragmatic: channels never leak goroutines, and slow receivers cannot back up the publisher in broadcast/watch modes.

Who should use this?

Backend Go developers building concurrent systems who are tired of rewriting the same channel patterns. Teams running worker pools, event buses, or configuration propagation systems will find the broadcast and watch types immediately useful. Anyone doing RPC-style request/response handoffs between goroutines should look at the oneshot package. This is not for frontend devs or anyone not writing concurrent Go code.

Verdict

Gochan solves real problems with a clean API and solid test coverage, but the 1.0% credibility score and 10 stars mean you're an early adopter. The documentation is thorough and the code appears well-tested, but low community visibility makes it a risk for production systems unless you're comfortable owning a small dependency. Worth watching, worth prototyping with, but weigh the maintenance tradeoff before betting on it in a critical service.

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.