- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 3,023 for panics (0.7 sec)
-
src/internal/reflectlite/value.go
} return f.Name() } // mustBeExported panics if f records that the value was obtained using // an unexported field. func (f flag) mustBeExported() { if f == 0 { panic(&ValueError{methodName(), 0}) } if f&flagRO != 0 { panic("reflect: " + methodName() + " using value obtained using unexported field") } } // mustBeAssignable panics if f records that the value is not assignable,
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 07 17:01:54 UTC 2024 - 13.6K bytes - Viewed (0) -
test/unsafebuiltins.go
assert(&s[0] == &p[0]) assert(len(s) == len(p)) assert(cap(s) == len(p)) // nil pointer with zero length returns nil assert(unsafe.Slice((*int)(nil), 0) == nil) // nil pointer with positive length panics mustPanic(func() { _ = unsafe.Slice((*int)(nil), 1) }) // negative length var neg int = -1 mustPanic(func() { _ = unsafe.Slice(new(byte), neg) }) // length too large
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Aug 31 17:15:15 UTC 2022 - 2.3K bytes - Viewed (0) -
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) -
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) -
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) -
src/sync/atomic/value.go
// Store sets the value of the [Value] v to val. // All calls to Store for a given Value must use values of the same concrete type. // Store of an inconsistent type panics, as does Store(nil). func (v *Value) Store(val any) { if val == nil { panic("sync/atomic: store of nil value into Value") } vp := (*efaceWords)(unsafe.Pointer(v)) vlp := (*efaceWords)(unsafe.Pointer(&val)) for { typ := LoadPointer(&vp.typ)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Feb 26 20:48:55 UTC 2024 - 5.9K bytes - Viewed (0) -
src/cmd/go/testdata/script/test_main_panic.txt
import "testing" func setup() { println("setup()") } func teardown() { println("teardown()") } func TestA(t *testing.T) { t.Run("1", func(t *testing.T) { t.Run("1", func(t *testing.T) { t.Parallel() panic("A/1/1 panics") }) t.Run("2", func(t *testing.T) { t.Parallel() println("A/1/2 is ok") }) }) } func TestMain(m *testing.M) { setup() defer teardown() m.Run()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 19 21:07:59 UTC 2020 - 603 bytes - Viewed (0) -
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) -
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) -
test/fixedbugs/bug457.go
// run // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Issue 4197: growing a slice of zero-width elements // panics on a division by zero. package main func main() { var x []struct{} x = append(x, struct{}{})
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon May 02 13:43:18 UTC 2016 - 331 bytes - Viewed (0)