Search Options

Results per page
Sort
Preferred Languages
Advance

Results 101 - 110 of 1,675 for mypanic (0.2 sec)

  1. test/bigmap.go

    		m[T{}] = V{1}
    		m[T{1}] = V{2}
    		if x, y := m[T{}][0], m[T{1}][0]; x != 1 || y != 2 {
    			println(x, y)
    			panic("bad map")
    		}
      	}
    	{
    		type T [100]byte
    		type V [1]byte
    		m := make(map[T]V)
    		m[T{}] = V{1}
    		m[T{1}] = V{2}
    		if x, y := m[T{}][0], m[T{1}][0]; x != 1 || y != 2 {
    			println(x, y)
    			panic("bad map")
    		}
    	}
    	{
    		type T [1]byte
    		type V [100]byte
    		m := make(map[T]V)
    		m[T{}] = V{1}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 25 02:41:07 UTC 2012
    - 2.5K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/finisher/finisher_test.go

    		},
    		{
    			name:    "Panic is propagated up",
    			timeout: timeoutFunc,
    			fn: func() (runtime.Object, error) {
    				panic("my panic")
    			},
    			expectedObj:   nil,
    			expectedErr:   nil,
    			expectedPanic: "my panic",
    		},
    		{
    			name:    "Panic is propagated with stack",
    			timeout: timeoutFunc,
    			fn: func() (runtime.Object, error) {
    				panic("my panic")
    			},
    			expectedObj:   nil,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 07 14:20:33 UTC 2021
    - 8.2K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/tools/internal/aliases/aliases_go121.go

    // It will never be created by go/types.
    type Alias struct{}
    
    func (*Alias) String() string         { panic("unreachable") }
    func (*Alias) Underlying() types.Type { panic("unreachable") }
    func (*Alias) Obj() *types.TypeName   { panic("unreachable") }
    func Rhs(alias *Alias) types.Type     { panic("unreachable") }
    
    // Unalias returns the type t for go <=1.21.
    func Unalias(t types.Type) types.Type { return t }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 962 bytes
    - Viewed (0)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to top