Search Options

Results per page
Sort
Preferred Languages
Advance

Results 111 - 120 of 1,056 for mypanic (0.15 sec)

  1. test/typeparam/chans.go

    		if ok {
    			panic(fmt.Sprintf("TryAcquire succeeded unexpectedly"))
    		}
    	}()
    	wg.Wait()
    
    	ex.Release(p)
    
    	p, ok = ex.TryAcquire()
    	if !ok {
    		panic(fmt.Sprintf("TryAcquire failed"))
    	}
    }
    
    func TestRanger() {
    	s, r := _Ranger[int]()
    
    	ctx := context.Background()
    	go func() {
    		// Receive one value then exit.
    		v, ok := r.Next(ctx)
    		if !ok {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 8.4K bytes
    - Viewed (0)
  2. test/typeparam/issue51250a.dir/main.go

    // license that can be found in the LICENSE file.
    
    package main
    
    import (
    	"./a"
    	"./b"
    )
    
    func main() {
    	switch b.I.(type) {
    	case a.G[b.T]:
    	case int:
    		panic("bad")
    	case float64:
    		panic("bad")
    	default:
    		panic("bad")
    	}
    
    	b.F(a.G[b.T]{})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 03 00:23:02 UTC 2022
    - 355 bytes
    - Viewed (0)
  3. test/fixedbugs/bug097.go

    func main() {
    	var a [3]A
    	for i := 0; i < 3; i++ {
    		a[i] = A{i}
    	}
    	if a[0][0] != 0 {
    		panic("fail a[0][0]")
    	}
    	if a[1][0] != 1 {
    		panic("fail a[1][0]")
    	}
    	if a[2][0] != 2 {
    		panic("fail a[2][0]")
    	}
    }
    
    /*
    uetli:~/Source/go1/test/bugs gri$ 6g bug097.go && 6l bug097.6 && 6.out
    
    panic on line 342 PC=0x13c2
    0x13c2?zi
    	mainĀ·main(1, 0, 1606416416, ...)
    	mainĀ·main(0x1, 0x7fff5fbff820, 0x0, ...)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Feb 18 21:15:42 UTC 2012
    - 1.1K bytes
    - Viewed (0)
  4. test/range3.go

    		bad = true
    	}
    	if bad {
    		panic("testint1")
    	}
    }
    
    func testint2() {
    	bad := false
    	j := 0
    	for i := range 4 {
    		if i != j {
    			println("range var", i, "want", j)
    			bad = true
    		}
    		j++
    	}
    	if j != 4 {
    		println("wrong count ranging over 4:", j)
    		bad = true
    	}
    	if bad {
    		panic("testint2")
    	}
    }
    
    func testint3() {
    	bad := false
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 01 17:20:08 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/finisher/finisher.go

    func (r *result) Return() (runtime.Object, error) {
    	switch {
    	case r.reason != nil:
    		// panic has higher precedence, the goroutine executing ResultFunc has panic'd,
    		// so propagate a panic to the caller.
    		panic(r.reason)
    	case r.err != nil:
    		return nil, r.err
    	default:
    		// if we are here, it means neither a panic, nor an error
    		if status, ok := r.object.(*metav1.Status); ok {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 07 14:20:33 UTC 2021
    - 6K bytes
    - Viewed (0)
  6. test/typeparam/issue51250a.dir/b.go

    package b
    
    import "./a"
    
    type T struct { a int }
    
    var I interface{} = a.G[T]{}
    
    //go:noinline
    func F(x interface{}) {
    	switch x.(type) {
    	case a.G[T]:
    	case int:
    		panic("bad")
    	case float64:
    		panic("bad")
    	default:
    		panic("bad")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 03 00:23:02 UTC 2022
    - 397 bytes
    - Viewed (0)
  7. test/fixedbugs/issue59338.go

    package main
    
    func main() {
    	var f1 func(int) int
    	f1 = g1
    	if f1(1) != g1(1) {
    		panic(1)
    	}
    
    	var f2 func(int) string = g2
    	if f2(2) != "" {
    		panic(2)
    	}
    
    	if g3(g1, 3) != g1(3) {
    		panic(3)
    	}
    
    	if g4(g2, 4) != "" {
    		panic(4)
    	}
    }
    
    func g1[P any](x P) P    { return x }
    func g2[P, Q any](x P) Q { var q Q; return q }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 03 22:12:27 UTC 2023
    - 700 bytes
    - Viewed (0)
  8. test/fixedbugs/issue7272.go

    	var a []int
    	var c chan int
    	var m map[int]int
    
    	close(c)
    	copy(a, a)
    	delete(m, 0)
    	panic(0)
    	print("foo")
    	println("bar")
    	recover()
    
    	(close(c))
    	(copy(a, a))
    	(delete(m, 0))
    	(panic(0))
    	(print("foo"))
    	(println("bar"))
    	(recover())
    
    	go close(c)
    	go copy(a, a)
    	go delete(m, 0)
    	go panic(0)
    	go print("foo")
    	go println("bar")
    	go recover()
    
    	defer close(c)
    	defer copy(a, a)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 763 bytes
    - Viewed (0)
  9. src/cmd/compile/internal/ir/mini.go

    func (n *miniNode) Type() *types.Type       { return nil }
    func (n *miniNode) SetType(*types.Type)     { panic(n.no("SetType")) }
    func (n *miniNode) Name() *Name             { return nil }
    func (n *miniNode) Sym() *types.Sym         { return nil }
    func (n *miniNode) Val() constant.Value     { panic(n.no("Val")) }
    func (n *miniNode) SetVal(v constant.Value) { panic(n.no("SetVal")) }
    func (n *miniNode) NonNil() bool            { return false }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 31 22:09:44 UTC 2022
    - 2.8K bytes
    - Viewed (0)
  10. test/typeparam/double.go

    	got := _DoubleElems[MySlice, int](arg)
    	if !reflect.DeepEqual(got, want) {
    		panic(fmt.Sprintf("got %s, want %s", got, want))
    	}
    
    	// constraint type inference
    	got = _DoubleElems[MySlice](arg)
    	if !reflect.DeepEqual(got, want) {
    		panic(fmt.Sprintf("got %s, want %s", got, want))
    	}
    
    	got = _DoubleElems(arg)
    	if !reflect.DeepEqual(got, want) {
    		panic(fmt.Sprintf("got %s, want %s", got, want))
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 1.5K bytes
    - Viewed (0)
Back to top