Search Options

Results per page
Sort
Preferred Languages
Advance

Results 81 - 90 of 1,056 for mypanic (0.29 sec)

  1. src/encoding/gob/error.go

    func error_(err error) {
    	panic(gobError{err})
    }
    
    // catchError is meant to be used as a deferred function to turn a panic(gobError) into a
    // plain error. It overwrites the error return of the function that deferred its call.
    func catchError(err *error) {
    	if e := recover(); e != nil {
    		ge, ok := e.(gobError)
    		if !ok {
    			panic(e)
    		}
    		*err = ge.err
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 30 23:03:07 UTC 2022
    - 1.3K bytes
    - Viewed (0)
  2. test/closure2.go

    		func() {
    			x.v++
    		}()
    		if x.v != 1 {
    			panic("x.v != 1")
    		}
    
    		type Y struct {
    			X
    		}
    		var y Y
    		func() {
    			y.v = 1
    		}()
    		if y.v != 1 {
    			panic("y.v != 1")
    		}
    	}
    
    	{
    		type Z struct {
    			a [3]byte
    		}
    		var z Z
    		func() {
    			i := 0
    			for z.a[1] = 1; i < 10; i++ {
    			}
    		}()
    		if z.a[1] != 1 {
    			panic("z.a[1] != 1")
    		}
    	}
    
    	{
    		w := 0
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 06 18:34:24 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  3. test/fixedbugs/issue8047b.go

    // license that can be found in the LICENSE file.
    
    // Issue 8047. Defer setup during panic shouldn't crash for nil defer.
    
    package main
    
    func main() {
    	defer func() {
    		// This recover recovers the panic caused by the nil defer func
    		// g(). The original panic(1) was already aborted/replaced by this
    		// new panic, so when this recover is done, the program completes
    		// normally.
    		recover()
    	}()
    	f()
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 04 16:32:38 UTC 2019
    - 575 bytes
    - Viewed (0)
  4. src/runtime/internal/wasitest/testdata/nonblock.go

    				panic(err)
    			}
    			f = os.NewFile(fd, path)
    		default:
    			panic("invalid test mode")
    		}
    
    		spawnWait := make(chan struct{})
    
    		wg.Add(1)
    		go func(f *os.File) {
    			defer f.Close()
    			defer wg.Done()
    
    			close(spawnWait)
    
    			<-ready
    
    			var buf [256]byte
    			n, err := f.Read(buf[:])
    			if err != nil {
    				panic(err)
    			}
    			os.Stderr.Write(buf[:n])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 26 17:59:52 UTC 2023
    - 1K bytes
    - Viewed (0)
  5. src/crypto/cipher/cbc.go

    	if len(iv) != b.BlockSize() {
    		panic("cipher.NewCBCEncrypter: IV length must equal block size")
    	}
    	return (*cbcEncrypter)(newCBC(b, iv))
    }
    
    func (x *cbcEncrypter) BlockSize() int { return x.blockSize }
    
    func (x *cbcEncrypter) CryptBlocks(dst, src []byte) {
    	if len(src)%x.blockSize != 0 {
    		panic("crypto/cipher: input not full blocks")
    	}
    	if len(dst) < len(src) {
    		panic("crypto/cipher: output smaller than input")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 28 03:55:33 UTC 2022
    - 5.4K bytes
    - Viewed (0)
  6. test/fixedbugs/issue46938.go

    package main
    
    import (
    	"strings"
    	"unsafe"
    )
    
    func main() {
    	defer func() {
    		err := recover()
    		if err == nil {
    			panic("expected panic")
    		}
    		if got := err.(error).Error(); !strings.Contains(got, "slice bounds out of range") {
    			panic("expected panic slice out of bound, got " + got)
    		}
    	}()
    	s := make([]int64, 100)
    	p := unsafe.Pointer(&s[0])
    	n := 1000
    
    	_ = (*[10]int64)(p)[:n:n]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 25 01:57:42 UTC 2021
    - 584 bytes
    - Viewed (0)
  7. test/fixedbugs/bug466.dir/b.go

    import "./a"
    
    func main() {
    	s := a.Func()
    	if s[0] != 1 {
    		println(s[0])
    		panic("s[0] != 1")
    	}
    	if s[1] != 2+3i {
    		println(s[1])
    		panic("s[1] != 2+3i")
    	}
    	if s[2] != 4+5i {
    		println(s[2])
    		panic("s[2] != 4+5i")
    	}
    
    	x := 1 + 2i
    	y := a.Mul(x)
    	if y != (1+2i)*(3+4i) {
    		println(y)
    		panic("y != (1+2i)*(3+4i)")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 499 bytes
    - Viewed (0)
  8. test/fixedbugs/issue48898.go

    				defer func() {
    					recover()
    				}()
    				defer panic(3)
    				panic(2)
    			}()
    			defer func() {
    				recover()
    			}()
    			panic(1)
    		}()
    		defer func() {}()
    	}()
    
    	var x = 123
    	func() {
    		// in the original issue, this defer was not executed (which is incorrect)
    		defer print(x)
    		func() {
    			defer func() {}()
    			panic(4)
    		}()
    	}()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 29 23:15:00 UTC 2021
    - 666 bytes
    - Viewed (0)
  9. test/fixedbugs/issue9604.go

    	// This is a problem for arm where there is no 16-bit comparison op.
    	if ^x != 0 {
    		panic("^uint16(0xffff) != 0")
    	}
    	if ^y != 1 {
    		panic("^uint16(0xfffe) != 1")
    	}
    	if -x != 1 {
    		panic("-uint16(0xffff) != 1")
    	}
    	if a+b != 0 {
    		panic("0x7000+0x9000 != 0")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jan 15 23:50:01 UTC 2015
    - 631 bytes
    - Viewed (0)
  10. test/fixedbugs/issue29190.go

    }
    
    func shouldPanic(str string, f func()) {
    	defer func() {
    		err := recover()
    		if err == nil {
    			panic("did not panic")
    		}
    		s := err.(error).Error()
    		if !strings.Contains(s, str) {
    			panic("got panic " + s + ", want " + str)
    		}
    	}()
    
    	f()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 08 16:58:57 UTC 2022
    - 707 bytes
    - Viewed (0)
Back to top