- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 1,938 for panics (0.23 sec)
-
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) -
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) -
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) -
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) -
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) -
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) -
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) -
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) -
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) -
test/fixedbugs/issue29612.dir/p2/ssa/ssa.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Apr 01 17:27:06 UTC 2019 - 453 bytes - Viewed (0)