Programming Code Center(PCC)
[GO]

(PCC)::[How-to-make-a-channel-of-strings-buffering-up-to-2-values-in-go-language]::[go]

File Name : channel-buffering.go

package main

import "fmt"

func main() {

    messages := make(chan string, 2)

    messages <- "buffered"
    messages <- "channel"

    fmt.Println(<-messages)
    fmt.Println(<-messages)
}

Output :

channel-buffering.jpg