Search Options

Results per page
Sort
Preferred Languages
Advance

Results 171 - 180 of 1,675 for mypanic (0.13 sec)

  1. test/typeswitch1.go

    	case nil:
    		return fmt.Sprint("nil ", xx)
    	}
    	panic("not reached")
    }
    
    func check(x interface{}, s string) {
    	w := whatis(x)
    	if w != s {
    		fmt.Println("whatis", x, "=>", w, "!=", s)
    		panic("fail")
    	}
    
    	w = whatis1(x)
    	if w != s {
    		fmt.Println("whatis1", x, "=>", w, "!=", s)
    		panic("fail")
    	}
    }
    
    func main() {
    	check(1, "signed 1")
    	check(uint(1), "unsigned 1")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 24 00:48:19 UTC 2012
    - 1.6K bytes
    - Viewed (0)
  2. test/fixedbugs/bug070.go

    import "fmt"
    
    func main() {
    	var i, k int
    	var r string
    outer:
    	for k = 0; k < 2; k++ {
    		r += fmt.Sprintln("outer loop top k", k)
    		if k != 0 {
    			panic("k not zero")
    		} // inner loop breaks this one every time
    		for i = 0; i < 2; i++ {
    			if i != 0 {
    				panic("i not zero")
    			} // loop breaks every time
    			r += fmt.Sprintln("inner loop top i", i)
    			if true {
    				r += "do break\n"
    				break outer
    			}
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 17 04:49:30 UTC 2012
    - 715 bytes
    - Viewed (0)
  3. src/math/floor_noasm.go

    package math
    
    const haveArchFloor = false
    
    func archFloor(x float64) float64 {
    	panic("not implemented")
    }
    
    const haveArchCeil = false
    
    func archCeil(x float64) float64 {
    	panic("not implemented")
    }
    
    const haveArchTrunc = false
    
    func archTrunc(x float64) float64 {
    	panic("not implemented")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 23 08:34:12 UTC 2024
    - 543 bytes
    - Viewed (0)
  4. test/fixedbugs/bug401.go

    }
    
    func main() {
    
    	var t T
    
    	if v := real(t.cplx()); v != 1 {
    		panic("not-inlined complex call failed")
    	}
    	_ = imag(t.cplx())
    
    	_ = real(t.cplx2())
    	if v := imag(t.cplx2()); v != 1 {
    		panic("potentially inlined complex call failed")
    	}
    
    	var i I
    	i = t
    	if v := real(i.cplx()); v != 1 {
    		panic("potentially inlined complex call failed")
    	}
    	_ = imag(i.cplx())
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 740 bytes
    - Viewed (0)
  5. test/fixedbugs/issue5793.go

    	return []byte{'a', 'b'}, '1', '2'
    }
    
    func main() {
    	if c := complex(complexArgs()); c != 5+7i {
    		panic(c)
    	}
    
    	if s := append(appendArgs()); len(s) != 2 || s[0] != "foo" || s[1] != "bar" {
    		panic(s)
    	}
    
    	if b := append(appendMultiArgs()); len(b) != 4 || b[0] != 'a' || b[1] != 'b' || b[2] != '1' || b[3] != '2' {
    		panic(b)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 793 bytes
    - Viewed (0)
  6. src/crypto/aes/cipher_asm.go

    func (c *aesCipherAsm) Encrypt(dst, src []byte) {
    	boring.Unreachable()
    	if len(src) < BlockSize {
    		panic("crypto/aes: input not full block")
    	}
    	if len(dst) < BlockSize {
    		panic("crypto/aes: output not full block")
    	}
    	if alias.InexactOverlap(dst[:BlockSize], src[:BlockSize]) {
    		panic("crypto/aes: invalid buffer overlap")
    	}
    	encryptBlockAsm(int(c.l)/4-1, &c.enc[0], &dst[0], &src[0])
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 14:58:19 UTC 2024
    - 3K bytes
    - Viewed (0)
  7. src/mime/example_test.go

    	header, err = dec.Decode("=?x-case?q?hello!?=")
    	if err != nil {
    		panic(err)
    	}
    	fmt.Println(header)
    	// Output:
    	// ¡Hola, señor!
    	// HELLO!
    }
    
    func ExampleWordDecoder_DecodeHeader() {
    	dec := new(mime.WordDecoder)
    	header, err := dec.DecodeHeader("=?utf-8?q?=C3=89ric?= <******@****.***>, =?utf-8?q?Ana=C3=AFs?= <******@****.***>")
    	if err != nil {
    		panic(err)
    	}
    	fmt.Println(header)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 20 18:41:18 UTC 2020
    - 2.9K bytes
    - Viewed (0)
  8. internal/dsync/drwmutex_test.go

    			t.Fatalf("unlock of unlocked RWMutex did not panic")
    		}
    	}()
    	mu := NewDRWMutex(ds, "test")
    	mu.Unlock(context.Background())
    }
    
    // Borrowed from rwmutex_test.go
    func TestUnlockPanic2(t *testing.T) {
    	mu := NewDRWMutex(ds, "test-unlock-panic-2")
    	defer func() {
    		if recover() == nil {
    			t.Fatalf("unlock of unlocked RWMutex did not panic")
    		}
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Sat Dec 24 03:49:07 UTC 2022
    - 9.7K bytes
    - Viewed (0)
  9. test/fixedbugs/bug114.go

    const D32 = ^0
    
    func main() {
    	if B32 != 0xFFFFFFFF {
    		println("1<<32 - 1 is", B32, "should be", 0xFFFFFFFF)
    		panic("fail")
    	}
    	if C32 != 0xFFFFFFFF {
    		println("(-1) & ((1<<32) - 1) is", C32, "should be", 0xFFFFFFFF)
    		panic("fail")
    	}
    	if D32 != -1 {
    		println("^0 is", D32, "should be", -1)
    		panic("fail")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 21 23:19:59 UTC 2012
    - 556 bytes
    - Viewed (0)
  10. test/fixedbugs/issue4066.go

    package main
    
    func main() {
    	n := foo()
    	if n != 2 {
    		println(n)
    		panic("wrong return value")
    	}
    }
    
    type terr struct{}
    
    func foo() (val int) {
    	val = 0
    	defer func() {
    		if x := recover(); x != nil {
    			_ = x.(terr)
    		}
    	}()
    	for {
    		val = 2
    		foo1()
    	}
    	panic("unreachable")
    }
    
    func foo1() {
    	panic(terr{})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jan 04 16:07:21 UTC 2013
    - 543 bytes
    - Viewed (0)
Back to top