Sha256: f55b3addd9803688a8c51c008cbdb5872e4040958a6094357b7d5d2e15a98859

Contents?: true

Size: 214 Bytes

Versions: 9

Compression:

Stored size: 214 Bytes

Contents

package main

import (
  "fmt"
  "time"
)

func main() {
  c := make(chan string)

  go func() {
    time.Sleep(1)
    c <- "go go go sleep 1!"
   }()

   fmt.Printf("%v\n", <-c)  // Wait for goroutine to finish
}

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
em-synchrony-1.0.6 examples/go/channel.go
em-synchrony-1.0.5 examples/go/channel.go
em-synchrony-1.0.4 examples/go/channel.go
em-synchrony-1.0.3 examples/go/channel.go
em-synchrony-1.0.2 examples/go/channel.go
em-synchrony-1.0.1 examples/go/channel.go
em-synchrony-1.0.0 examples/go/channel.go
em-synchrony-0.3.0.beta.1 examples/go/channel.go
em-synchrony-0.2.0 examples/go/channel.go