Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 3,023 for panics (0.21 sec)

  1. src/crypto/internal/boring/boring_test.go

    // and inheriting that code's tests.
    
    package boring
    
    import "testing"
    
    // Test that func init does not panic.
    func TestInit(t *testing.T) {}
    
    // Test that Unreachable panics.
    func TestUnreachable(t *testing.T) {
    	defer func() {
    		if Enabled {
    			if err := recover(); err == nil {
    				t.Fatal("expected Unreachable to panic")
    			}
    		} else {
    			if err := recover(); err != nil {
    				t.Fatalf("expected Unreachable to be a no-op")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 17 15:22:22 UTC 2017
    - 842 bytes
    - Viewed (0)
  2. test/fixedbugs/issue29612.dir/main.go

    // Do not panic on conversion to anonymous interface, which
    // is similar-looking interface types in different packages.
    
    package main
    
    import (
    	"fmt"
    
    	ssa1 "issue29612.dir/p1/ssa"
    	ssa2 "issue29612.dir/p2/ssa"
    )
    
    func main() {
    	v1 := &ssa1.T{}
    	_ = v1
    
    	v2 := &ssa2.T{}
    	ssa2.Works(v2)
    	ssa2.Panics(v2) // This call must not panic
    
    	swt(v1, 1)
    	swt(v2, 2)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 25 14:19:25 UTC 2020
    - 845 bytes
    - Viewed (0)
  3. test/fixedbugs/issue16130.go

    			panic(fmt.Sprintf("got %T, expected runtime.Error", r))
    		}
    		if !strings.Contains(re.Error(), "interface conversion") {
    			panic(fmt.Sprintf("got %q, expected interface conversion error", re.Error()))
    		}
    	}()
    	e := (interface{})(0)
    	if _, ok := e.(I); ok {
    		panic("unexpected interface conversion success")
    	}
    	fmt.Println(e.(I))
    	panic("unexpected interface conversion success")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Dec 08 23:22:37 UTC 2016
    - 948 bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder.go

    // If a handler already exists for pattern, Handle panics.
    func (m *PathRecorderMux) HandleFunc(path string, handler func(http.ResponseWriter, *http.Request)) {
    	m.Handle(path, http.HandlerFunc(handler))
    }
    
    // UnlistedHandle registers the handler for the given pattern, but doesn't list it.
    // If a handler already exists for pattern, Handle panics.
    func (m *PathRecorderMux) UnlistedHandle(path string, handler http.Handler) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Apr 12 01:52:15 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  5. src/math/rand/rand.go

    // from the default [Source].
    // It panics if n <= 0.
    func Int63n(n int64) int64 { return globalRand().Int63n(n) }
    
    // Int31n returns, as an int32, a non-negative pseudo-random number in the half-open interval [0,n)
    // from the default [Source].
    // It panics if n <= 0.
    func Int31n(n int32) int32 { return globalRand().Int31n(n) }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 22:09:08 UTC 2024
    - 16.9K bytes
    - Viewed (0)
  6. src/runtime/cgo/handle.go

    	h := handleIdx.Add(1)
    	if h == 0 {
    		panic("runtime/cgo: ran out of handle space")
    	}
    
    	handles.Store(h, v)
    	return Handle(h)
    }
    
    // Value returns the associated Go value for a valid handle.
    //
    // The method panics if the handle is invalid.
    func (h Handle) Value() any {
    	v, ok := handles.Load(uintptr(h))
    	if !ok {
    		panic("runtime/cgo: misuse of an invalid Handle")
    	}
    	return v
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 08 16:59:11 UTC 2023
    - 3.6K bytes
    - Viewed (0)
  7. pkg/test/framework/components/echo/port.go

    	for _, port := range ps {
    		if name == port.Name {
    			return port, true
    		}
    	}
    	return Port{}, false
    }
    
    // MustForName calls ForName and panics if not found.
    func (ps Ports) MustForName(name string) Port {
    	p, found := ps.ForName(name)
    	if !found {
    		panic("port does not exist for name " + name)
    	}
    	return p
    }
    
    // ForProtocol returns the first port found with the given protocol.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Apr 13 18:10:05 UTC 2022
    - 4.4K bytes
    - Viewed (0)
  8. test/makeslice.go

    		testInts(1<<32 - 1)
    		testBytes(1<<32 - 1)
    	}
    }
    
    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()
    }
    
    func testInts(n uint64) {
    	testMakeInts(n)
    	testMakeCopyInts(n)
    	testMakeInAppendInts(n)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 07 17:50:24 UTC 2020
    - 5.5K bytes
    - Viewed (0)
  9. test/fixedbugs/issue29612.dir/p2/ssa/ssa.go

    package ssa
    
    type T struct{}
    
    func (T) foo() {}
    
    type fooer interface {
    	foo()
    }
    
    func Works(v interface{}) {
    	switch v.(type) {
    	case interface{}:
    		v.(fooer).foo()
    	}
    }
    
    func Panics(v interface{}) {
    	switch v.(type) {
    	case interface{}:
    		v.(fooer).foo()
    		v.(interface{ foo() }).foo()
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 01 17:27:06 UTC 2019
    - 453 bytes
    - Viewed (0)
  10. test/typeparam/smallest.go

    		~string
    }
    
    func Smallest[T Ordered](s []T) T {
    	r := s[0] // panics if slice is empty
    	for _, v := range s[1:] {
    		if v < r {
    			r = v
    		}
    	}
    	return r
    }
    
    func main() {
    	vec1 := []float64{5.3, 1.2, 32.8}
    	vec2 := []string{"abc", "def", "aaa"}
    
    	want1 := 1.2
    	if got := Smallest(vec1); got != want1 {
    		panic(fmt.Sprintf("got %d, want %d", got, want1))
    	}
    	want2 := "aaa"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 825 bytes
    - Viewed (0)
Back to top