Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 147 for panic (0.17 sec)

  1. internal/event/targetlist_test.go

    		panic(err)
    	}
    
    	targetListCase3 := NewTargetList()
    	if err := targetListCase3.Add(&ExampleTarget{TargetID{"3", "testcase"}, false, false}); err != nil {
    		panic(err)
    	}
    	if err := targetListCase3.Add(&ExampleTarget{TargetID{"1", "webhook"}, false, false}); err != nil {
    		panic(err)
    	}
    
    	testCases := []struct {
    		targetList     *TargetList
    Go
    - Registered: 2023-11-26 19:28
    - Last Modified: 2023-10-07 15:07
    - 7.1K bytes
    - Viewed (0)
  2. src/bytes/buffer.go

    // another n bytes. After Grow(n), at least n bytes can be written to the
    // buffer without another allocation.
    // If n is negative, Grow will panic.
    // If the buffer can't grow it will panic with [ErrTooLarge].
    func (b *Buffer) Grow(n int) {
    	if n < 0 {
    		panic("bytes.Buffer.Grow: negative count")
    	}
    	m := b.grow(n)
    	b.buf = b.buf[:m]
    }
    
    // Write appends the contents of p to the buffer, growing the buffer as
    Go
    - Registered: 2023-11-28 11:13
    - Last Modified: 2023-10-13 17:10
    - 15.7K bytes
    - Viewed (0)
  3. src/cmd/cgo/internal/test/callback_c_gccgo.c

    //go:build gccgo
    
    #include "_cgo_export.h"
    #include <stdint.h>
    #include <stdio.h>
    #include <stdlib.h>
    
    /* Test calling panic from C.  This is what SWIG does.  */
    
    extern void _cgo_panic(const char *);
    extern void *_cgo_allocate(size_t);
    
    void
    callPanic(void)
    {
    	_cgo_panic("panic from C");
    C
    - Registered: 2023-11-28 11:13
    - Last Modified: 2023-05-12 12:00
    - 452 bytes
    - Viewed (0)
  4. src/cmd/cgo/internal/test/issue42018_windows.go

    	if n > 0 {
    		recurseHANDLE(n-1, p, v)
    	}
    	if uintptr(unsafe.Pointer(p)) != v {
    		panic("adjusted notinheap pointer")
    	}
    }
    
    func recurseHWND(n int, p C.HWND, v uintptr) {
    	if n > 0 {
    		recurseHWND(n-1, p, v)
    	}
    	if uintptr(unsafe.Pointer(p)) != v {
    		panic("adjusted notinheap pointer")
    	}
    Go
    - Registered: 2023-11-28 11:13
    - Last Modified: 2023-05-12 12:00
    - 1.1K bytes
    - Viewed (0)
  5. src/cmd/cgo/internal/test/callback_c_gc.c

    #include <stdint.h>
    #include <stdio.h>
    #include <stdlib.h>
    
    /* Test calling panic from C.  This is what SWIG does.  */
    
    extern void crosscall2(void (*fn)(void *, int), void *, int);
    extern void _cgo_panic(void *, int);
    extern void _cgo_allocate(void *, int);
    
    void
    callPanic(void)
    {
    	struct { const char *p; } a;
    	a.p = "panic from C";
    	crosscall2(_cgo_panic, &a, sizeof a);
    	*(int*)1 = 1;
    C
    - Registered: 2023-11-28 11:13
    - Last Modified: 2023-05-12 12:00
    - 592 bytes
    - Viewed (0)
  6. 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")
    		}
    Go
    - Registered: 2023-11-26 19:28
    - Last Modified: 2022-12-24 03:49
    - 9.7K bytes
    - Viewed (0)
  7. internal/lsync/lrwmutex_test.go

    	ctx := context.Background()
    	lrwm := NewLRWMutex()
    
    	if !lrwm.GetRLock(ctx, "", "object1", time.Second) {
    		panic("Failed to acquire read lock")
    	}
    	// fmt.Println("1st read lock acquired, waiting...")
    
    	if !lrwm.GetRLock(ctx, "", "object1", time.Second) {
    		panic("Failed to acquire read lock")
    	}
    	// fmt.Println("2nd read lock acquired, waiting...")
    
    	go func() {
    		time.Sleep(2 * time.Second)
    Go
    - Registered: 2023-11-26 19:28
    - Last Modified: 2023-03-05 04:57
    - 7.9K bytes
    - Viewed (0)
  8. doc/godebug.md

    The [GODEBUG History](#history) gives the exact defaults for each Go toolchain version.
    For example, Go 1.21 introduces the `panicnil` setting,
    controlling whether `panic(nil)` is allowed;
    it defaults to `panicnil=0`, making `panic(nil)` a run-time error.
    Using `panicnil=1` restores the behavior of Go 1.20 and earlier.
    
    When compiling a work module or workspace that declares
    Plain Text
    - Registered: 2023-11-28 11:13
    - Last Modified: 2023-11-21 16:29
    - 10.2K bytes
    - Viewed (0)
  9. src/bufio/bufio.go

    	if b.r > 0 {
    		copy(b.buf, b.buf[b.r:b.w])
    		b.w -= b.r
    		b.r = 0
    	}
    
    	if b.w >= len(b.buf) {
    		panic("bufio: tried to fill full buffer")
    	}
    
    	// Read new data: try a limited number of times.
    	for i := maxConsecutiveEmptyReads; i > 0; i-- {
    		n, err := b.rd.Read(b.buf[b.w:])
    		if n < 0 {
    			panic(errNegativeRead)
    		}
    		b.w += n
    		if err != nil {
    			b.err = err
    			return
    		}
    		if n > 0 {
    Go
    - Registered: 2023-11-28 11:13
    - Last Modified: 2023-10-12 14:39
    - 21.8K bytes
    - Viewed (0)
  10. src/bufio/scan_test.go

    func TestDontLoopForever(t *testing.T) {
    	s := NewScanner(strings.NewReader("abc"))
    	s.Split(loopAtEOFSplit)
    	// Expect a panic
    	defer func() {
    		err := recover()
    		if err == nil {
    			t.Fatal("should have panicked")
    		}
    		if msg, ok := err.(string); !ok || !strings.Contains(msg, "empty tokens") {
    			panic(err)
    		}
    	}()
    	for count := 0; s.Scan(); count++ {
    		if count > 1000 {
    			t.Fatal("looping")
    		}
    	}
    Go
    - Registered: 2023-11-28 11:13
    - Last Modified: 2023-09-22 16:22
    - 14.3K bytes
    - Viewed (0)
Back to top