Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 2,835 for panic2 (0.12 sec)

  1. src/internal/reflectlite/export_test.go

    import (
    	"unsafe"
    )
    
    // Field returns the i'th field of the struct v.
    // It panics if v's Kind is not Struct or i is out of range.
    func Field(v Value, i int) Value {
    	if v.kind() != Struct {
    		panic(&ValueError{"reflect.Value.Field", v.kind()})
    	}
    	tt := (*structType)(unsafe.Pointer(v.typ()))
    	if uint(i) >= uint(len(tt.Fields)) {
    		panic("reflect: Field index out of range")
    	}
    	field := &tt.Fields[i]
    	typ := field.Typ
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 17:01:54 UTC 2024
    - 3K bytes
    - Viewed (0)
  2. pkg/apis/core/json.go

    var _ = json.Marshaler(&AvoidPods{})
    var _ = json.Unmarshaler(&AvoidPods{})
    
    // MarshalJSON panics to prevent marshalling of internal structs
    func (AvoidPods) MarshalJSON() ([]byte, error) { panic("do not marshal internal struct") }
    
    // UnmarshalJSON panics to prevent unmarshalling of internal structs
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Sep 25 18:06:51 UTC 2019
    - 1.2K bytes
    - Viewed (0)
  3. src/math/rand/v2/rand.go

    // It panics if n <= 0.
    func (r *Rand) Int64N(n int64) int64 {
    	if n <= 0 {
    		panic("invalid argument to Int64N")
    	}
    	return int64(r.uint64n(uint64(n)))
    }
    
    // Uint64N returns, as a uint64, a non-negative pseudo-random number in the half-open interval [0,n).
    // It panics if n == 0.
    func (r *Rand) Uint64N(n uint64) uint64 {
    	if n == 0 {
    		panic("invalid argument to Uint64N")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 02:25:49 UTC 2024
    - 12.8K bytes
    - Viewed (0)
  4. test/fixedbugs/issue15975.go

    func nilInterfaceDeferCall() {
    	var x Closer
    	defer x.Close()
    	// if it panics when evaluating x.Close, it should not reach here
    	fail = true
    }
    
    func shouldPanic(f func()) {
    	defer func() {
    		if recover() == nil {
    			panic("did not panic")
    		}
    	}()
    	f()
    }
    
    func main() {
    	shouldPanic(nilInterfaceDeferCall)
    	if fail {
    		panic("fail")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 08 20:35:53 UTC 2016
    - 572 bytes
    - Viewed (0)
  5. src/cmd/go/testdata/script/test_fuzz.txt

    stdout 'fuzz target'
    
    # Test that f.Error within f.Fuzz panics
    ! go test error_fuzz_fn_fuzz_test.go
    ! stdout ^ok
    ! stdout 'error here'
    stdout FAIL
    stdout 'fuzz target'
    
    # Test that f.Fail within f.Fuzz panics
    ! go test fail_fuzz_fn_fuzz_test.go
    ! stdout ^ok
    stdout FAIL
    stdout 'fuzz target'
    
    # Test that f.Skip within f.Fuzz panics
    ! go test skip_fuzz_fn_fuzz_test.go
    ! stdout ^ok
    ! stdout 'skip here'
    stdout FAIL
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 16 16:53:11 UTC 2023
    - 10.2K bytes
    - Viewed (0)
  6. src/crypto/internal/boring/boring.go

    func init() {
    	C._goboringcrypto_BORINGSSL_bcm_power_on_self_test()
    	if C._goboringcrypto_FIPS_mode() != 1 {
    		panic("boringcrypto: not in FIPS mode")
    	}
    	sig.BoringCrypto()
    }
    
    // Unreachable marks code that should be unreachable
    // when BoringCrypto is in use. It panics.
    func Unreachable() {
    	panic("boringcrypto: invalid code execution")
    }
    
    // provided by runtime to avoid os import.
    func runtime_arg0() string
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 06 14:00:54 UTC 2024
    - 3K bytes
    - Viewed (0)
  7. 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)
  8. 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)
  9. test/recover1.go

    	defer mustNotRecover()
    	defer func() {
    		recover()
    		defer mustRecover(3)
    		panic(3)
    	}()
    	panic(2)
    }
    
    func test4() {
    	// Single panic.
    	defer mustNotRecover()
    	defer func() {
    		recover()
    	}()
    	panic(4)
    }
    
    func test5() {
    	// Single panic but recover called via defer
    	defer mustNotRecover()
    	defer func() {
    		defer recover()
    	}()
    	panic(5)
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 2.5K bytes
    - Viewed (0)
  10. src/vendor/golang.org/x/crypto/cryptobyte/builder.go

    // that outlive the continuation.
    //
    // If the continuation panics with a value of type BuildError then the inner
    // error will be returned as the error from Bytes. If the child panics
    // otherwise then Bytes will repanic with the same value.
    type BuilderContinuation func(child *Builder)
    
    // BuildError wraps an error. If a BuilderContinuation panics with this value,
    // the panic will be recovered and the inner error will be returned from
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 10 16:32:44 UTC 2023
    - 9.9K bytes
    - Viewed (0)
Back to top