Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 258 for frecv (0.06 sec)

  1. test/closedchan.go

    	shouldPanic(func() { c.Nbsend(1) })
    
    	// the value should have been discarded.
    	if x := c.Recv(); x != 0 {
    		println("test1: recv on closed got non-zero after send on closed:", x, c.Impl())
    		failed = true
    	}
    
    	// similarly Send.
    	shouldPanic(func() { c.Send(2) })
    	if x := c.Recv(); x != 0 {
    		println("test1: recv on closed got non-zero after send on closed:", x, c.Impl())
    		failed = true
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 17 04:48:57 UTC 2012
    - 5.8K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/tools/internal/stdlib/stdlib.go

    //
    // Example: "(*Buffer).Grow" -> (true, "Buffer", "Grow")
    func (sym *Symbol) SplitMethod() (ptr bool, recv, name string) {
    	if sym.Kind != Method {
    		panic("not a method")
    	}
    	recv, name, _ = strings.Cut(sym.Name, ".")
    	recv = recv[len("(") : len(recv)-len(")")]
    	ptr = recv[0] == '*'
    	if ptr {
    		recv = recv[len("*"):]
    	}
    	return
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  3. test/chan/select7.go

    	select {
    	case <-c:
    	case <-c2:
    	}
    }
    
    func send1(recv func(<-chan int)) {
    	c := make(chan int)
    	go recv(c)
    	runtime.Gosched()
    	c <- 1
    }
    
    func send2(recv func(<-chan int)) {
    	c := make(chan int)
    	go recv(c)
    	runtime.Gosched()
    	select {
    	case c <- 1:
    	}
    }
    
    func send3(recv func(<-chan int)) {
    	c := make(chan int)
    	go recv(c)
    	runtime.Gosched()
    	c2 := make(chan int)
    	select {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 932 bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types2/selection.go

    func (s *Selection) Type() Type {
    	switch s.kind {
    	case MethodVal:
    		// The type of x.f is a method with its receiver type set
    		// to the type of x.
    		sig := *s.obj.(*Func).typ.(*Signature)
    		recv := *sig.recv
    		recv.typ = s.recv
    		sig.recv = &recv
    		return &sig
    
    	case MethodExpr:
    		// The type of x.f is a function (without receiver)
    		// and an additional first argument with the same type as x.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 19:32:17 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  5. src/go/types/selection.go

    func (s *Selection) Type() Type {
    	switch s.kind {
    	case MethodVal:
    		// The type of x.f is a method with its receiver type set
    		// to the type of x.
    		sig := *s.obj.(*Func).typ.(*Signature)
    		recv := *sig.recv
    		recv.typ = s.recv
    		sig.recv = &recv
    		return &sig
    
    	case MethodExpr:
    		// The type of x.f is a function (without receiver)
    		// and an additional first argument with the same type as x.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/registry/generic/registry/decorated_watcher.go

    	var recv, send watch.Event
    	var ok bool
    	defer close(d.resultCh)
    	for {
    		select {
    		case recv, ok = <-d.w.ResultChan():
    			if !ok {
    				// The underlying channel was closed, cancel our context
    				d.cancel()
    				return
    			}
    			switch recv.Type {
    			case watch.Added, watch.Modified, watch.Deleted, watch.Bookmark:
    				d.decorator(recv.Object)
    				send = recv
    			case watch.Error:
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 02 19:25:31 UTC 2021
    - 2.3K bytes
    - Viewed (1)
  7. src/cmd/compile/internal/typecheck/typecheck.go

    // expression "recv.sym".
    func NewMethodExpr(pos src.XPos, recv *types.Type, sym *types.Sym) *ir.SelectorExpr {
    	// Compute the method set for recv.
    	var ms []*types.Field
    	if recv.IsInterface() {
    		ms = recv.AllMethods()
    	} else {
    		mt := types.ReceiverBaseType(recv)
    		if mt == nil {
    			base.FatalfAt(pos, "type %v has no receiver base type", recv)
    		}
    		CalcMethods(mt)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 20 19:08:34 UTC 2024
    - 30.5K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/typecheck/dcl.go

    func NewMethodType(sig *types.Type, recv *types.Type) *types.Type {
    	nrecvs := 0
    	if recv != nil {
    		nrecvs++
    	}
    
    	// TODO(mdempsky): Move this function to types.
    	// TODO(mdempsky): Preserve positions, names, and package from sig+recv.
    
    	params := make([]*types.Field, nrecvs+sig.NumParams())
    	if recv != nil {
    		params[0] = types.NewField(base.Pos, nil, recv)
    	}
    	for i, param := range sig.Params() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 14 13:15:50 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  9. src/go/doc/doc_test.go

    			Methods: []*Func{
    				{Name: "M1", Recv: "S1", Orig: "S1", Level: 0},
    				{Name: "M2", Recv: "S1", Orig: "S1", Level: 0},
    				{Name: "M4", Recv: "S1", Orig: "s3", Level: 1},
    				{Name: "P1", Recv: "*S1", Orig: "*S1", Level: 0},
    			},
    		},
    		{
    			Name: "S2",
    			Methods: []*Func{
    				{Name: "M3", Recv: "S2", Orig: "S2", Level: 0},
    			},
    		},
    	},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:31:52 UTC 2022
    - 6.7K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unmarshal/unmarshal.go

    		argidx := -1
    
    		recv := fn.Type().(*types.Signature).Recv()
    		if fn.Name() == "Unmarshal" && recv == nil {
    			// "encoding/json".Unmarshal
    			// "encoding/xml".Unmarshal
    			// "encoding/asn1".Unmarshal
    			switch fn.Pkg().Path() {
    			case "encoding/json", "encoding/xml", "encoding/asn1":
    				argidx = 1 // func([]byte, interface{})
    			}
    		} else if fn.Name() == "Decode" && recv != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 3.1K bytes
    - Viewed (0)
Back to top