mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-27 13:32:56 +03:00
Merge pull request #307 from NKCSS/master
Changed Print function to show the variable type
This commit is contained in:
commit
a9880277b2
@ -1,4 +1,4 @@
|
|||||||
---
|
---
|
||||||
name: Go
|
name: Go
|
||||||
category: language
|
category: language
|
||||||
language: Go
|
language: Go
|
||||||
@ -259,7 +259,7 @@ func learnConcurrency() {
|
|||||||
// that are ready to communicate.
|
// that are ready to communicate.
|
||||||
select {
|
select {
|
||||||
case i := <-c: // the value received can be assigned to a variable
|
case i := <-c: // the value received can be assigned to a variable
|
||||||
fmt.Println("it's a", i)
|
fmt.Printf("it's a %T", i)
|
||||||
case <-cs: // or the value received can be discarded
|
case <-cs: // or the value received can be discarded
|
||||||
fmt.Println("it's a string")
|
fmt.Println("it's a string")
|
||||||
case <-cc: // empty channel, not ready for communication.
|
case <-cc: // empty channel, not ready for communication.
|
||||||
|
Loading…
Reference in New Issue
Block a user