- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 36 for Panicf (0.17 sec)
-
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>
HTML - Registered: Tue May 07 11:14:38 GMT 2024 - Last Modified: Thu Apr 11 20:22:45 GMT 2024 - 211.6K bytes - Viewed (0) -
src/bytes/buffer_test.go
} } type panicReader struct{ panic bool } func (r panicReader) Read(p []byte) (int, error) { if r.panic { panic("oops") } return 0, io.EOF } // Make sure that an empty Buffer remains empty when // it is "grown" before a Read that panics func TestReadFromPanicReader(t *testing.T) { // First verify non-panic behaviour var buf Buffer
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Fri Apr 26 13:31:36 GMT 2024 - 18.6K bytes - Viewed (0) -
src/cmd/cgo/internal/test/callback_c_gc.c
#include <stdint.h> #include <stdio.h> #include <stdlib.h> /* Test calling panic from C. This is what SWIG does. */ extern void crosscall2(void (*fn)(void *, int), void *, int); extern void _cgo_panic(void *, int); extern void _cgo_allocate(void *, int); void callPanic(void) { struct { const char *p; } a; a.p = "panic from C"; crosscall2(_cgo_panic, &a, sizeof a); *(int*)1 = 1;
C - Registered: Tue Apr 23 11:13:09 GMT 2024 - Last Modified: Fri May 12 12:00:02 GMT 2023 - 592 bytes - Viewed (0) -
src/bufio/export_test.go
// Exported for testing only. import ( "unicode/utf8" ) var IsSpace = isSpace const DefaultBufSize = defaultBufSize func (s *Scanner) MaxTokenSize(n int) { if n < utf8.UTFMax || n > 1e9 { panic("bad max token size") } if n < len(s.buf) { s.buf = make([]byte, n) } s.maxTokenSize = n } // ErrOrEOF is like Err, but returns EOF. Used to test a corner case. func (s *Scanner) ErrOrEOF() error {
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Thu Nov 02 17:17:44 GMT 2017 - 597 bytes - Viewed (0) -
src/cmd/cgo/ast_go118.go
"go/token" ) func (f *File) walkUnexpected(x interface{}, context astContext, visit func(*File, interface{}, astContext)) { switch n := x.(type) { default: error_(token.NoPos, "unexpected type %T in walk", x) panic("unexpected type") case *ast.IndexListExpr: f.walk(&n.X, ctxExpr, visit) f.walk(n.Indices, ctxExpr, visit) } } func funcTypeTypeParams(n *ast.FuncType) *ast.FieldList { return n.TypeParams }
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Wed Nov 30 21:45:10 GMT 2022 - 730 bytes - Viewed (0) -
src/bufio/bufio_test.go
func TestNegativeRead(t *testing.T) { // should panic with a description pointing at the reader, not at itself. // (should NOT panic with slice index error, for example.) b := NewReader(new(negativeReader)) defer func() { switch err := recover().(type) { case nil: t.Fatal("read did not panic") case error:
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Fri Feb 10 18:56:01 GMT 2023 - 51.5K 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,
Go - Registered: Tue Apr 23 11:13:09 GMT 2024 - Last Modified: Fri May 12 12:00:02 GMT 2023 - 111.5K bytes - Viewed (0) -
src/cmd/api/main_test.go
} func (w *Walker) emitf(format string, args ...any) { f := strings.Join(w.scope, ", ") + ", " + fmt.Sprintf(format, args...) if strings.Contains(f, "\n") { panic("feature contains newlines: " + f) } if _, dup := w.features[f]; dup { panic("duplicate feature inserted: " + f) } w.features[f] = true if verbose { log.Printf("feature: %s", f) } }
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Tue Apr 09 20:48:51 GMT 2024 - 31.4K bytes - Viewed (0) -
src/archive/zip/reader_test.go
b, err := hex.DecodeString(s) if err != nil { panic(err) } return b } func returnBigZipBytes() (r io.ReaderAt, size int64) { b := biggestZipBytes() for i := 0; i < 2; i++ { r, err := NewReader(bytes.NewReader(b), int64(len(b))) if err != nil { panic(err) } f, err := r.File[0].Open() if err != nil { panic(err) } b, err = io.ReadAll(f)
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Wed Mar 27 18:23:49 GMT 2024 - 55.3K bytes - Viewed (0) -
src/arena/arena.go
// allocated from an arena, it is returned untouched. This function is useful // to more easily let an arena-allocated value out-live its arena. // T must be a pointer, a slice, or a string, otherwise this function will panic. func Clone[T any](s T) T { return runtime_arena_heapify(s).(T) } //go:linkname reflect_arena_New reflect.arena_New func reflect_arena_New(a *Arena, typ any) any { return runtime_arena_arena_New(a.a, typ) }
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Wed Oct 12 20:23:36 GMT 2022 - 4.3K bytes - Viewed (0)