Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for SChan (0.03 sec)

  1. test/closedchan.go

    	return "(<- operator)"
    }
    
    // indirect operations via select
    type SChan chan int
    
    func (c SChan) Send(x int) {
    	select {
    	case c <- x:
    	}
    }
    
    func (c SChan) Nbsend(x int) bool {
    	select {
    	default:
    		return false
    	case c <- x:
    		return true
    	}
    	panic("nbsend")
    }
    
    func (c SChan) Recv() int {
    	select {
    	case x := <-c:
    		return x
    	}
    	panic("recv")
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 17 04:48:57 UTC 2012
    - 5.8K bytes
    - Viewed (0)
Back to top