- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 35 for panic2 (0.28 sec)
-
src/reflect/value.go
if f == 0 { panic(&ValueError{valueMethodName(), Invalid}) } // Assignable if addressable and not read-only. if f&flagRO != 0 { panic("reflect: " + valueMethodName() + " using value obtained using unexported field") } if f&flagAddr == 0 { panic("reflect: " + valueMethodName() + " using unaddressable value") } } // Addr returns a pointer value representing the address of v.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 22 21:17:41 UTC 2024 - 119.9K bytes - Viewed (0) -
src/reflect/all_test.go
r := recover() if r == nil { panic("did not panic") } if expect != "" { var s string switch r := r.(type) { case string: s = r case *ValueError: s = r.Error() default: panic(fmt.Sprintf("panicked with unexpected type %T", r)) } if !strings.HasPrefix(s, "reflect") { panic(`panic string does not start with "reflect": ` + s) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 218.8K bytes - Viewed (0) -
doc/go1.17_spec.html
</pre> <h3 id="Handling_panics">Handling panics</h3> <p> Two built-in functions, <code>panic</code> and <code>recover</code>, assist in reporting and handling <a href="#Run_time_panics">run-time panics</a> and program-defined error conditions. </p> <pre class="grammar"> func panic(interface{}) func recover() interface{} </pre> <p>
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Apr 11 20:22:45 UTC 2024 - 211.6K bytes - Viewed (0) -
src/net/http/server.go
// first, and then reply. // // Except for reading the body, handlers should not modify the // provided Request. // // If ServeHTTP panics, the server (the caller of ServeHTTP) assumes // that the effect of the panic was isolated to the active request. // It recovers the panic, logs a stack trace to the server error log, // and either closes the network connection or sends an HTTP/2
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Jun 07 17:57:01 UTC 2024 - 123.4K bytes - Viewed (0) -
src/database/sql/sql_test.go
if x == nil { t.Fatal("expected panic") } conn.closemu.Lock() closed := conn.dc == nil conn.closemu.Unlock() if !closed { t.Fatal("expected connection to be closed after panic") } }() err = conn.Raw(func(dc any) error { panic("Conn.Raw panic should return an error") }) t.Fatal("expected panic from Raw func") }() }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 18:42:28 UTC 2024 - 111.6K bytes - Viewed (0) -
src/database/sql/sql.go
if err != nil { return } fPanic := true dc.Mutex.Lock() defer func() { dc.Mutex.Unlock() // If f panics fPanic will remain true. // Ensure an error is passed to release so the connection // may be discarded. if fPanic { err = driver.ErrBadConn } release(err) }() err = f(dc.ci) fPanic = false return }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:16:53 UTC 2024 - 103.6K bytes - Viewed (0) -
src/cmd/cgo/internal/test/callback.go
} defer func() { s := recover() if s == nil { t.Fatal("did not panic") } if s.(string) != "callback panic" { t.Fatal("wrong panic:", s) } if !lockedOSThread() { t.Fatal("lost lock on OS thread after panic") } }() nestedCall(func() { panic("callback panic") }) panic("nestedCall returned") } // Callback with zero arguments used to make the stack misaligned,
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 12 12:00:02 UTC 2023 - 111.5K bytes - Viewed (0) -
src/net/http/serve_test.go
if err != nil { panic(err) } for i := 0; i < n; i++ { res, err := Get(url) if err != nil { log.Panicf("Get: %v", err) } all, err := io.ReadAll(res.Body) res.Body.Close() if err != nil { log.Panicf("ReadAll: %v", err) } body := string(all) if body != "Hello world.\n" { log.Panicf("Got body: %q", body) } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Jun 07 17:57:01 UTC 2024 - 202K bytes - Viewed (0) -
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation_test.go
panic(err) } res, err := schema.NewStructural(convertedProps) if err != nil { panic(err) } return res } // Creates an *unstructured by decoding the given YAML. Panics on error func mustUnstructured(source string) interface{} { source = FixTabsOrDie(source)
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Jun 04 17:14:10 UTC 2024 - 159.9K bytes - Viewed (0) -
src/cmd/go/internal/load/pkg.go
// to loadPackageData. func (pre *preload) flush() { // flush is usually deferred. // Don't hang program waiting for workers on panic. if v := recover(); v != nil { panic(v) } close(pre.cancel) for i := 0; i < preloadWorkerCount; i++ { pre.sema <- struct{}{} } } func cleanImport(path string) string { orig := path
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 28 17:00:51 UTC 2024 - 120K bytes - Viewed (0)