Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 1,571 for chan2 (0.04 sec)

  1. test/syntax/chan.go

    // license that can be found in the LICENSE file.
    
    package main
    
    type xyz struct {
        ch chan
    } // ERROR "unexpected .*}.* in channel type|missing channel element type"
    
    func Foo(y chan) { // ERROR "unexpected .*\).* in channel type|missing channel element type"
    }
    
    func Bar(x chan, y int) { // ERROR "unexpected comma in channel type|missing channel element type"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 492 bytes
    - Viewed (0)
  2. test/syntax/chan1.go

    // errorcheck
    
    // Copyright 2010 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package main
    
    var c chan int
    var v int
    
    func main() {
    	if c <- v { // ERROR "cannot use c <- v as value|send statement used as value"
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Nov 28 02:31:54 UTC 2020
    - 384 bytes
    - Viewed (0)
  3. src/runtime/chan.go

    	dataqsiz uint           // size of the circular queue
    	buf      unsafe.Pointer // points to an array of dataqsiz elements
    	elemsize uint16
    	closed   uint32
    	timer    *timer // timer feeding this chan
    	elemtype *_type // element type
    	sendx    uint   // send index
    	recvx    uint   // receive index
    	recvq    waitq  // list of recv waiters
    	sendq    waitq  // list of send waiters
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:16:50 UTC 2024
    - 25.9K bytes
    - Viewed (0)
  4. src/runtime/testdata/testprog/crashdump.go

    }
    
    func CrashDumpsAllThreads() {
    	const count = 4
    	runtime.GOMAXPROCS(count + 1)
    
    	chans := make([]chan bool, count)
    	for i := range chans {
    		chans[i] = make(chan bool)
    		go crashDumpsAllThreadsLoop(i, chans[i])
    	}
    
    	// Wait for all the goroutines to start executing.
    	for _, c := range chans {
    		<-c
    	}
    
    	// Tell our parent that all the goroutines are executing.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 22 00:34:25 UTC 2021
    - 917 bytes
    - Viewed (0)
  5. src/cmd/cgo/internal/testlife/testdata/life.go

    	}
    }
    
    // Keep the channels visible from Go.
    var chans [4]chan bool
    
    // Double return value is just for testing.
    //
    //export GoStart
    func GoStart(i, xdim, ydim, xstart, xend, ystart, yend C.int, a *C.int, n *C.int) (int, int) {
    	c := make(chan bool, int(C.MYCONST))
    	go func() {
    		C.DoStep(xdim, ydim, xstart, xend, ystart, yend, a, n)
    		c <- true
    	}()
    	chans[i] = c
    	return int(i), int(i + 100)
    }
    
    //export GoWait
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 892 bytes
    - Viewed (0)
  6. src/cmd/cgo/internal/testplugin/testdata/issue25756/plugin/life.go

    	}
    }
    
    // Keep the channels visible from Go.
    var chans [4]chan bool
    
    // Double return value is just for testing.
    //
    //export GoStart
    func GoStart(i, xdim, ydim, xstart, xend, ystart, yend C.int, a *C.int, n *C.int) (int, int) {
    	c := make(chan bool, int(C.MYCONST))
    	go func() {
    		C.DoStep(xdim, ydim, xstart, xend, ystart, yend, a, n)
    		c <- true
    	}()
    	chans[i] = c
    	return int(i), int(i + 100)
    }
    
    //export GoWait
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 889 bytes
    - Viewed (0)
  7. src/internal/singleflight/singleflight.go

    // results when they are ready.
    func (g *Group) DoChan(key string, fn func() (any, error)) <-chan Result {
    	ch := make(chan Result, 1)
    	g.mu.Lock()
    	if g.m == nil {
    		g.m = make(map[string]*call)
    	}
    	if c, ok := g.m[key]; ok {
    		c.dups++
    		c.chans = append(c.chans, ch)
    		g.mu.Unlock()
    		return ch
    	}
    	c := &call{chans: []chan<- Result{ch}}
    	c.wg.Add(1)
    	g.m[key] = c
    	g.mu.Unlock()
    
    	go g.doCall(c, key, fn)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 30 20:49:56 UTC 2022
    - 3.1K bytes
    - Viewed (0)
  8. test/gcgort.go

    	case a.mapT == nil:
    		return errors.New(a.name + " missing mapT")
    	case a.mapPointerKeyT == nil:
    		return errors.New(a.name + " missing mapPointerKeyT")
    	case a.chanT == nil:
    		return errors.New(a.name + " missing chanT")
    	case a.interfaceT == nil:
    		return errors.New(a.name + " missing interfaceT")
    	default:
    		return nil
    	}
    }
    
    var types = []modifier{
    	modifier{
    		name: "bool",
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 08 21:15:48 UTC 2018
    - 34.5K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/internal/typeparams/coretype.go

    		return U
    	}
    	ch, ok := U.(*types.Chan)
    	if !ok {
    		return nil // no core type as identical < len(terms) and U is not a channel.
    	}
    	// https://go.dev/ref/spec#Core_types
    	// "the type chan E if T contains only bidirectional channels, or the type chan<- E or
    	// <-chan E depending on the direction of the directional channels present."
    	for chans := identical; chans < len(terms); chans++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  10. test/typeswitch.go

    // license that can be found in the LICENSE file.
    
    // Test simple type switches, including chans, maps etc.
    
    package main
    
    import "os"
    
    const (
    	Bool = iota
    	Int
    	Float
    	String
    	Struct
    	Chan
    	Array
    	Map
    	Func
    	Last
    )
    
    type S struct {
    	a int
    }
    
    var s S = S{1234}
    
    var c = make(chan int)
    
    var a = []int{0, 1, 2, 3}
    
    var m = make(map[string]int)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 24 00:48:19 UTC 2012
    - 1.8K bytes
    - Viewed (0)
Back to top