Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 2,835 for panic2 (0.15 sec)

  1. test/typeparam/settable.go

    	if len(s) != 1 || s[0] != 1 {
    		panic(fmt.Sprintf("got %v, want %v", s, []int{1}))
    	}
    
    	defer func() {
    		if recover() == nil {
    			panic("did not panic as expected")
    		}
    	}()
    	// This should type check but should panic at run time,
    	// because it will make a slice of *SettableInt and then call
    	// Set on a nil value.
    	fromStrings3[*SettableInt]([]string{"1"})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 23:48:58 UTC 2022
    - 2.7K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/sys/windows/dll_windows.go

    		}
    	}
    	return nil
    }
    
    // mustFind is like Find but panics if search fails.
    func (p *LazyProc) mustFind() {
    	e := p.Find()
    	if e != nil {
    		panic(e)
    	}
    }
    
    // Addr returns the address of the procedure represented by p.
    // The return value can be passed to Syscall to run the procedure.
    // It will panic if the procedure cannot be found.
    func (p *LazyProc) Addr() uintptr {
    	p.mustFind()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Dec 05 12:36:42 UTC 2020
    - 12K bytes
    - Viewed (0)
  3. src/internal/reflectlite/swapper.go

    // slice.
    //
    // Swapper panics if the provided interface is not a slice.
    func Swapper(slice any) func(i, j int) {
    	v := ValueOf(slice)
    	if v.Kind() != Slice {
    		panic(&ValueError{Method: "Swapper", Kind: v.Kind()})
    	}
    	// Fast path for slices of size 0 and 1. Nothing to swap.
    	switch v.Len() {
    	case 0:
    		return func(i, j int) { panic("reflect: slice index out of range") }
    	case 1:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:30 UTC 2024
    - 2K bytes
    - Viewed (0)
  4. 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)
  5. src/reflect/swapper.go

    // slice.
    //
    // Swapper panics if the provided interface is not a slice.
    func Swapper(slice any) func(i, j int) {
    	v := ValueOf(slice)
    	if v.Kind() != Slice {
    		panic(&ValueError{Method: "Swapper", Kind: v.Kind()})
    	}
    	// Fast path for slices of size 0 and 1. Nothing to swap.
    	switch v.Len() {
    	case 0:
    		return func(i, j int) { panic("reflect: slice index out of range") }
    	case 1:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:30 UTC 2024
    - 2K bytes
    - Viewed (0)
  6. src/slices/sort.go

    // For floating-point E, Max propagates NaNs (any NaN value in x
    // forces the output to be NaN).
    func Max[S ~[]E, E cmp.Ordered](x S) E {
    	if len(x) < 1 {
    		panic("slices.Max: empty list")
    	}
    	m := x[0]
    	for i := 1; i < len(x); i++ {
    		m = max(m, x[i])
    	}
    	return m
    }
    
    // MaxFunc returns the maximal value in x, using cmp to compare elements.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 07 23:54:41 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/ir/mini.go

    func (n *miniNode) Type() *types.Type       { return nil }
    func (n *miniNode) SetType(*types.Type)     { panic(n.no("SetType")) }
    func (n *miniNode) Name() *Name             { return nil }
    func (n *miniNode) Sym() *types.Sym         { return nil }
    func (n *miniNode) Val() constant.Value     { panic(n.no("Val")) }
    func (n *miniNode) SetVal(v constant.Value) { panic(n.no("SetVal")) }
    func (n *miniNode) NonNil() bool            { return false }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 31 22:09:44 UTC 2022
    - 2.8K bytes
    - Viewed (0)
  8. src/reflect/type.go

    	//	t.IsVariadic() == true
    	//
    	// IsVariadic panics if the type's Kind is not Func.
    	IsVariadic() bool
    
    	// Elem returns a type's element type.
    	// It panics if the type's Kind is not Array, Chan, Map, Pointer, or Slice.
    	Elem() Type
    
    	// Field returns a struct type's i'th field.
    	// It panics if the type's Kind is not Struct.
    	// It panics if i is not in the range [0, NumField()).
    	Field(i int) StructField
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 85.5K bytes
    - Viewed (0)
  9. pkg/test/framework/components/echo/config/source.go

    	// MustTemplate calls Template and panics if an error occurs.
    	MustTemplate() *param.Template
    
    	// YAML reads the yaml from this Source. If this source contains parameters,
    	// it is evaluated as a template.
    	YAML() (string, error)
    
    	// YAMLOrFail calls GetYAML and fails if an error occurs.
    	YAMLOrFail(t test.Failer) string
    
    	// MustYAML calls GetYAML and panics if an error occurs.
    	MustYAML() string
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jul 25 19:30:47 UTC 2022
    - 5.2K bytes
    - Viewed (0)
  10. 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)
Back to top