- Sort Score
- Result 10 results
- Languages All
Results 91 - 100 of 3,023 for panics (0.22 sec)
-
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) -
pkg/apis/rbac/helpers.go
r.PolicyRule.NonResourceURLs = combine(r.PolicyRule.NonResourceURLs, urls) return r } // RuleOrDie calls the binding method and panics if there is an error. func (r *PolicyRuleBuilder) RuleOrDie() PolicyRule { ret, err := r.Rule() if err != nil { panic(err) } return ret } func combine(s1, s2 []string) []string { s := sets.NewString(s1...) s.Insert(s2...) return s.List() }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Sun Feb 23 15:11:00 UTC 2020 - 12.1K bytes - Viewed (0) -
src/cmd/link/internal/ld/util.go
fmt.Fprintf(os.Stderr, os.Args[0]+": "+format+"\n", a...) nerrors++ if *flagH { panic("error") } Exit(2) } // afterErrorAction updates 'nerrors' on error and invokes exit or // panics in the proper circumstances. func afterErrorAction() { nerrors++ if *flagH { panic("error") } if nerrors > 20 { Exitf("too many errors") } } // Errorf logs an error message. //
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Feb 22 20:39:11 UTC 2023 - 2.5K bytes - Viewed (0) -
src/go/ast/print.go
// localError wraps locally caught errors so we can distinguish // them from genuine panics which we don't want to return as errors. type localError struct { err error } // printf is a convenience wrapper that takes care of print errors. func (p *printer) printf(format string, args ...any) { if _, err := fmt.Fprintf(p, format, args...); err != nil { panic(localError{err}) } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 28 21:32:41 UTC 2024 - 5.9K bytes - Viewed (0) -
src/runtime/lfstack.go
if atomic.Cas64((*uint64)(head), old, next) { return unsafe.Pointer(node) } } } func (head *lfstack) empty() bool { return atomic.Load64((*uint64)(head)) == 0 } // lfnodeValidate panics if node is not a valid address for use with // lfstack.push. This only needs to be called when node is allocated. func lfnodeValidate(node *lfnode) { if base, _, _ := findObject(uintptr(unsafe.Pointer(node)), 0, 0); base != 0 {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 25 19:53:03 UTC 2024 - 2K bytes - Viewed (0) -
test/fixedbugs/issue22881.go
// The RHS panics in all of these cases. package main import "fmt" func main() { for i, f := range []func(map[int]int){ f0, f1, f2, f3, f4, f5, f6, f7, f8, } { m := map[int]int{} func() { // wrapper to scope the defer. defer func() { recover() }() f(m) // Will panic. Shouldn't modify m. fmt.Printf("RHS didn't panic, case f%d\n", i) }() if len(m) != 0 {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 20 01:47:07 UTC 2018 - 2K bytes - Viewed (0) -
staging/src/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/cr_client.go
return nil, err } return &CrV1Client{client}, nil } // NewForConfigOrDie creates a new CrV1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *CrV1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new CrV1Client for the given RESTClient. func New(c rest.Interface) *CrV1Client {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Oct 20 04:39:39 UTC 2021 - 3K bytes - Viewed (0) -
src/log/slog/value_test.go
for i, v1 := range vals { for j, v2 := range vals { got := v1.Equal(v2) want := i == j if got != want { t.Errorf("%v.Equal(%v): got %t, want %t", v1, v2, got, want) } } } } func panics(f func()) (b bool) { defer func() { if x := recover(); x != nil { b = true } }() f() return false } func TestValueString(t *testing.T) { for _, test := range []struct { v Value
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 16 16:12:08 UTC 2024 - 6.9K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/internal/analysisinternal/extractdoc.go
// license that can be found in the LICENSE file. package analysisinternal import ( "fmt" "go/parser" "go/token" "strings" ) // MustExtractDoc is like [ExtractDoc] but it panics on error. // // To use, define a doc.go file such as: // // // Package halting defines an analyzer of program termination. // // // // # Analyzer halting // // // // halting: reports whether execution will halt.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 18 21:28:13 UTC 2023 - 3.4K bytes - Viewed (0) -
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)