Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 1,571 for chan2 (0.04 sec)

  1. pkg/kubelet/pluginmanager/operationexecutor/operation_executor_test.go

    	}
    	return false
    }
    
    func setup() (chan interface{}, chan interface{}, OperationExecutor) {
    	ch, quit := make(chan interface{}), make(chan interface{})
    	return ch, quit, NewOperationExecutor(newFakeOperationGenerator(ch, quit))
    }
    
    // This function starts by writing to ch and blocks on the quit channel
    // until it is closed by the currently running test
    func startOperationAndBlock(ch chan<- interface{}, quit <-chan interface{}) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Jul 30 03:35:26 UTC 2022
    - 4.8K bytes
    - Viewed (0)
  2. src/internal/types/testdata/fixedbugs/issue51139.go

    // license that can be found in the LICENSE file.
    
    package p
    
    func f[S []T, T any](S, T) {}
    
    func _() {
    	type L chan int
    	f([]L{}, make(chan int))
    	f([]L{}, make(L))
    	f([]chan int{}, make(chan int))
    	f /* ERROR "[]chan int does not satisfy []L ([]chan int missing in []p.L)" */ ([]chan int{}, make(L))
    }
    
    // test case from issue
    
    func Append[S ~[]T, T any](s S, x ...T) S { /* implementation of append */ return s }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 01 20:55:32 UTC 2023
    - 649 bytes
    - Viewed (0)
  3. test/chan/fifo.go

    package main
    
    import "os"
    
    const N = 10
    
    func AsynchFifo() {
    	ch := make(chan int, N)
    	for i := 0; i < N; i++ {
    		ch <- i
    	}
    	for i := 0; i < N; i++ {
    		if <-ch != i {
    			print("bad receive\n")
    			os.Exit(1)
    		}
    	}
    }
    
    func Chain(ch <-chan int, val int, in <-chan int, out chan<- int) {
    	<-in
    	if <-ch != val {
    		panic(val)
    	}
    	out <- 1
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 18 22:35:07 UTC 2017
    - 896 bytes
    - Viewed (0)
  4. staging/src/k8s.io/apimachinery/pkg/watch/watch.go

    // ResultChan implements Interface
    func (w emptyWatch) ResultChan() <-chan Event {
    	return chan Event(w)
    }
    
    // FakeWatcher lets you test anything that consumes a watch.Interface; threadsafe.
    type FakeWatcher struct {
    	result  chan Event
    	stopped bool
    	sync.Mutex
    }
    
    func NewFake() *FakeWatcher {
    	return &FakeWatcher{
    		result: make(chan Event),
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 12 20:06:22 UTC 2024
    - 8.1K bytes
    - Viewed (1)
  5. src/internal/types/testdata/spec/assignability.go

    		_ _RecvChan = C
    		_ _Chan     = C
    
    		_ SendChan = c
    		_ RecvChan = c
    		_ Chan     = c
    
    		_ SendChan = C // ERRORx `cannot use C .* as SendChan value`
    		_ RecvChan = C // ERRORx `cannot use C .* as RecvChan value`
    		_ Chan     = C
    		_ Chan     = make /* ERRORx `cannot use make\(chan Basic\) .* as Chan value` */ (chan Basic)
    	)
    
    	var (
    		_ _CC = C // ERRORx `cannot use C .* as _CC value`
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 09 17:24:42 UTC 2023
    - 5.1K bytes
    - Viewed (0)
  6. internal/pubsub/pubsub_test.go

    		t.Fatalf("want %d subscribers, got %d", want, got)
    	}
    }
    
    func TestSubscribeExceedingLimit(t *testing.T) {
    	ps := New[Maskable, Maskable](2)
    	ch1 := make(chan Maskable, 1)
    	ch2 := make(chan Maskable, 1)
    	ch3 := make(chan Maskable, 1)
    	doneCh := make(chan struct{})
    	defer close(doneCh)
    	if err := ps.Subscribe(MaskAll, ch1, doneCh, nil); err != nil {
    		t.Fatalf("unexpected error: %v", err)
    	}
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Jan 18 07:03:17 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  7. test/fixedbugs/issue9083.go

    	x = make(map[int]int, zero) // ERROR "cannot use make\(map\[int\]int, zero\)|incompatible"
    	x = make(chan int)          // ERROR "cannot use make\(chan int\)|incompatible"
    	x = make(chan int, 0)       // ERROR "cannot use make\(chan int, 0\)|incompatible"
    	x = make(chan int, zero)    // ERROR "cannot use make\(chan int, zero\)|incompatible"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 28 14:28:33 UTC 2023
    - 846 bytes
    - Viewed (0)
  8. test/chan/sieve2.go

    import (
    	"container/heap"
    	"container/ring"
    )
    
    // Return a chan of odd numbers, starting from 5.
    func odds() chan int {
    	out := make(chan int, 50)
    	go func() {
    		n := 5
    		for {
    			out <- n
    			n += 2
    		}
    	}()
    	return out
    }
    
    // Return a chan of odd multiples of the prime number p, starting from p*p.
    func multiples(p int) chan int {
    	out := make(chan int, 10)
    	go func() {
    		n := p * p
    		for {
    			out <- n
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Feb 19 06:44:02 UTC 2012
    - 3.9K bytes
    - Viewed (0)
  9. src/runtime/race/testdata/map_test.go

    	ch := make(chan bool, 1)
    	go func() {
    		delete(m, "")
    		ch <- true
    	}()
    	m[""] = true
    	<-ch
    }
    
    func TestRaceMapLenDelete(t *testing.T) {
    	m := make(map[string]bool)
    	ch := make(chan bool, 1)
    	go func() {
    		delete(m, "a")
    		ch <- true
    	}()
    	_ = len(m)
    	<-ch
    }
    
    func TestRaceMapVariable(t *testing.T) {
    	ch := make(chan bool, 1)
    	m := make(map[int]int)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 03 22:09:38 UTC 2017
    - 5.1K bytes
    - Viewed (0)
  10. src/internal/types/testdata/fixedbugs/issue47115.go

    // license that can be found in the LICENSE file.
    
    package p
    
    type C0 interface{ int }
    type C1 interface{ chan int }
    type C2 interface{ chan int | <-chan int }
    type C3 interface{ chan int | chan float32 }
    type C4 interface{ chan int | chan<- int }
    type C5[T any] interface{ ~chan T | chan<- T }
    
    func _[T any](ch T) {
    	ch <- /* ERRORx `cannot send to ch .* no core type` */ 0
    }
    
    func _[T C0](ch T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:54:27 UTC 2023
    - 840 bytes
    - Viewed (0)
Back to top