Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 359 for chan2 (0.04 sec)

  1. src/internal/fmtsort/sort_test.go

    			}
    		}
    		return "UNSAFEPTR???"
    	case "chan int":
    		c := key.Interface().(chan int)
    		for i := range chans {
    			if c == chans[i] {
    				return fmt.Sprintf("CHAN%d", i)
    			}
    		}
    		return "CHAN???"
    	default:
    		return fmt.Sprint(key)
    	}
    }
    
    var (
    	ints  [3]int
    	chans = makeChans()
    	pin   runtime.Pinner
    )
    
    func makeChans() []chan int {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 6.9K bytes
    - Viewed (0)
  2. src/go/types/chan.go

    func NewChan(dir ChanDir, elem Type) *Chan {
    	return &Chan{dir: dir, elem: elem}
    }
    
    // Dir returns the direction of channel c.
    func (c *Chan) Dir() ChanDir { return c.dir }
    
    // Elem returns the element type of channel c.
    func (c *Chan) Elem() Type { return c.elem }
    
    func (c *Chan) Underlying() Type { return c }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 1K bytes
    - Viewed (0)
  3. 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)
  4. src/cmd/compile/internal/syntax/testdata/map2.go

    		var zerok K
    		var zerov V
    		return zerok, zerov, false
    	}
    	return keyval.key, keyval.val, true
    }
    
    // chans
    
    func chans_Ranger[T any]() (*chans_Sender[T], *chans_Receiver[T])
    
    // A sender is used to send values to a Receiver.
    type chans_Sender[T any] struct {
    	values chan<- T
    	done   <-chan bool
    }
    
    func (s *chans_Sender[T]) Send(v T) bool {
    	select {
    	case s.values <- v:
    		return true
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 01 12:49:49 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  5. platforms/core-execution/snapshots/src/test/groovy/org/gradle/internal/snapshot/CaseInsensitiveVfsRelativePathTest.groovy

            def char1 = left as char
            def char2 = right as char
            def caseInsensitiveResult = left.toUpperCase() == right.toUpperCase() ? 0 : result
    
            expect:
            compareCharsIgnoringCase(char1, char2) == caseInsensitiveResult
            compareCharsIgnoringCase(char2, char1) == -caseInsensitiveResult
            compareChars(char1, char2) == Character.compare(char1, char2)
            compareChars(char2, char1) == Character.compare(char2, char1)
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 09:34:50 UTC 2023
    - 2.7K bytes
    - Viewed (0)
  6. platforms/core-execution/snapshots/src/main/java/org/gradle/internal/snapshot/PathUtil.java

        static int compareCharsIgnoringCase(char char1, char char2) {
            if (char1 == char2) {
                return 0;
            }
            return isFileSeparator(char1)
                ? isFileSeparator(char2)
                    ? 0
                    : -1
                : isFileSeparator(char2)
                    ? 1
                    : compareDifferentCharsIgnoringCase(char1, char2);
        }
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 09:34:50 UTC 2023
    - 8.2K bytes
    - Viewed (0)
  7. src/internal/types/testdata/fixedbugs/issue62157.go

    func _() {
    	type namedA chan int
    	type namedB chan<- int
    
    	var a chan int
    	var A namedA
    	var b chan<- int
    	var B namedB
    
    	// Defined types win over channel types irrespective of channel direction.
    	f(A, b /* ERROR "cannot use b (variable of type chan<- int) as namedA value in argument to f" */)
    	f(b /* ERROR "cannot use b (variable of type chan<- int) as namedA value in argument to f" */, A)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 29 23:22:35 UTC 2023
    - 3.2K bytes
    - Viewed (0)
  8. test/typeparam/builtins.go

    package builtins
    
    // close
    
    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 f1[T C1](ch T) {
    	close(ch)
    }
    
    func f2[T C3](ch T) {
    	close(ch)
    }
    
    func f3[T C4](ch T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 09:04:48 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  9. src/go/types/exprstring_test.go

    	dup("x.(interface{})"),
    	dup("x.(interface{m(); n(x int); E})"),
    	dup("x.(interface{m(); n(x int) T; E; F})"),
    
    	dup("x.(map[K]V)"),
    
    	dup("x.(chan E)"),
    	dup("x.(<-chan E)"),
    	dup("x.(chan<- chan int)"),
    	dup("x.(chan<- <-chan int)"),
    	dup("x.(<-chan chan int)"),
    	dup("x.(chan (<-chan int))"),
    
    	dup("f()"),
    	dup("f(x)"),
    	dup("int(x)"),
    	dup("f(x, x + y)"),
    	dup("f(s...)"),
    	dup("f(a, s...)"),
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jul 31 17:08:18 UTC 2023
    - 2.5K bytes
    - Viewed (0)
  10. 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)
Back to top