Golang: Channels

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • go

    The Go programming language

  • GitHub repository

  • 100-days-of-golang

    Scripts and Resources for the 100 days of golang series (In progress)

  • I have a few more patterns to demonstrate that have been provided in the GitHub on the 100 days of Golang repository.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • go-formatter

    A curated list of awesome Go frameworks, libraries and software

  • Awesome Go projects and frmaeworks

  • duckduckgo-locales

    Translation files for <a href="https://duckduckgo.com"> </a>

  • package main import ( "fmt" "net/http" "sync" ) func pingGoogle(c chan string, wg *sync.WaitGroup) { defer wg.Done() res, _ := http.Get("http://google.com") c <- res.Status } func pingDuckDuckGo(c chan string, wg *sync.WaitGroup) { defer wg.Done() res, _ := http.Get("https://duckduckgo.com") c <- res.Status } func pingBraveSearch(c chan string, wg *sync.WaitGroup) { defer wg.Done() res, _ := http.Get("https://search.brave.com") c <- res.Status } func main() { gogChan := make(chan string) ddgChan := make(chan string) braveChan := make(chan string) var wg sync.WaitGroup wg.Add(3) go pingDuckDuckGo(ddgChan, &wg) go pingGoogle(gogChan, &wg) go pingBraveSearch(braveChan, &wg) openChannels := 3 go func() { wg.Wait() close(gogChan) close(ddgChan) close(braveChan) }() for openChannels > 0 { select { case msg1, ok := <-gogChan: if !ok { openChannels-- } else { fmt.Println("Google responded:", msg1) } case msg2, ok := <-ddgChan: if !ok { openChannels-- } else { fmt.Println("DuckDuckGo responded:", msg2) } case msg3, ok := <-braveChan: if !ok { openChannels-- } else { fmt.Println("BraveSearch responded:", msg3) } } } }

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts