Skip to content
jaeseok.an edited this page Apr 12, 2019 · 4 revisions

Channel

  • bidirectionnal channel 은 unidirectional channel로 convert가능
    func f(x <-chan int) int {         
           return n    
    }     
    func main() {    
          c make(chan int)       
          n := f(c)    
    }
    
  • closed channel
    • read
      x, ok <- mychan    
      if !ok {    
          return false   
      }   
      
    • write는 panic발생

test

Clone this wiki locally