Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 17 of 17 for ChanDir (0.1 sec)

  1. src/go/internal/gcimporter/ureader.go

    	case pkgbits.TypeTypeParam:
    		return r.dict.tparams[r.Len()]
    
    	case pkgbits.TypeArray:
    		len := int64(r.Uint64())
    		return types.NewArray(r.typ(), len)
    	case pkgbits.TypeChan:
    		dir := types.ChanDir(r.Len())
    		return types.NewChan(dir, r.typ())
    	case pkgbits.TypeMap:
    		return types.NewMap(r.typ(), r.typ())
    	case pkgbits.TypePointer:
    		return types.NewPointer(r.typ())
    	case pkgbits.TypeSignature:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 16.6K bytes
    - Viewed (0)
  2. src/reflect/value.go

    // It panics if v's Kind is not [Chan] or
    // v is a receive-only channel.
    func (v Value) Close() {
    	v.mustBe(Chan)
    	v.mustBeExported()
    	tt := (*chanType)(unsafe.Pointer(v.typ()))
    	if ChanDir(tt.Dir)&SendDir == 0 {
    		panic("reflect: close of receive-only channel")
    	}
    
    	chanclose(v.pointer())
    }
    
    // CanComplex reports whether [Value.Complex] can be used without panicking.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:17:41 UTC 2024
    - 119.9K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/typecheck/expr.go

    	if t == nil {
    		n.SetType(nil)
    		return n
    	}
    	if !t.IsChan() {
    		base.Errorf("invalid operation: %v (receive from non-chan type %v)", n, t)
    		n.SetType(nil)
    		return n
    	}
    
    	if !t.ChanDir().CanRecv() {
    		base.Errorf("invalid operation: %v (receive from send-only type %v)", n, t)
    		n.SetType(nil)
    		return n
    	}
    
    	n.SetType(t.Elem())
    	return n
    }
    
    // tcSPtr typechecks an OSPTR node.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/typecheck/func.go

    	t := l.Type()
    	if t == nil {
    		n.SetType(nil)
    		return n
    	}
    	if !t.IsChan() {
    		base.Errorf("invalid operation: %v (non-chan type %v)", n, t)
    		n.SetType(nil)
    		return n
    	}
    
    	if !t.ChanDir().CanSend() {
    		base.Errorf("invalid operation: %v (cannot close receive-only channel)", n)
    		n.SetType(nil)
    		return n
    	}
    	return n
    }
    
    // tcComplex typechecks an OCOMPLEX node.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 06 15:23:18 UTC 2024
    - 21.1K bytes
    - Viewed (0)
  5. src/text/template/exec.go

    			break
    		}
    		om := fmtsort.Sort(val)
    		for _, m := range om {
    			oneIteration(m.Key, m.Value)
    		}
    		return
    	case reflect.Chan:
    		if val.IsNil() {
    			break
    		}
    		if val.Type().ChanDir() == reflect.SendDir {
    			s.errorf("range over send-only channel %v", val)
    			break
    		}
    		i := 0
    		for ; ; i++ {
    			elem, ok := val.Recv()
    			if !ok {
    				break
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 21:22:24 UTC 2024
    - 32K bytes
    - Viewed (0)
  6. src/reflect/all_test.go

    	checkSameType(t, ChanOf(SendDir, TypeOf(T1(1))), (chan<- T1)(nil))
    
    	// check String form of ChanDir
    	if crt.ChanDir().String() != "<-chan" {
    		t.Errorf("chan dir: have %q, want %q", crt.ChanDir().String(), "<-chan")
    	}
    	if cst.ChanDir().String() != "chan<-" {
    		t.Errorf("chan dir: have %q, want %q", cst.ChanDir().String(), "chan<-")
    	}
    }
    
    func TestChanOfGC(t *testing.T) {
    	done := make(chan bool, 1)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 218.8K bytes
    - Viewed (0)
  7. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"CallExpr.Rparen", Field, 0},
    		{"CaseClause", Type, 0},
    		{"CaseClause.Body", Field, 0},
    		{"CaseClause.Case", Field, 0},
    		{"CaseClause.Colon", Field, 0},
    		{"CaseClause.List", Field, 0},
    		{"ChanDir", Type, 0},
    		{"ChanType", Type, 0},
    		{"ChanType.Arrow", Field, 1},
    		{"ChanType.Begin", Field, 0},
    		{"ChanType.Dir", Field, 0},
    		{"ChanType.Value", Field, 0},
    		{"CommClause", Type, 0},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
Back to top