@kjk1/

gobook channels close 2

Go

No description

fork
loading
Files
  • main.go

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.6932283515979814","path":"main.go","file":{"path":"main.go","content":{"asEncoding":{"base64":"cGFja2FnZSBtYWluCgppbXBvcnQgKAoJImZtdCIKKQoKZnVuYyBtYWluKCkgewoJLy8gOnNob3cgc3RhcnQKCWNoIDo9IG1ha2UoY2hhbiBzdHJpbmcpCgljbG9zZShjaCkKCXYgOj0gPC1jaAoJZm10LlByaW50ZigiUmVjZWl2ZSBmcm9tIGNsb3NlZCBjaGFubmVsIGltbWVkaWF0ZWx5IHJldHVybnMgemVybyB2YWx1ZSBvZiB0aGUgdHlwZTogJSN2XG4iLCB2KQoJLy8gOnNob3cgZW5kCn0="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package main

import (
	"fmt"
)

func main() {
	// :show start
	ch := make(chan string)
	close(ch)
	v := <-ch
	fmt.Printf("Receive from closed channel immediately returns zero value of the type: %#v\n", v)
	// :show end
}