- Sort Score
- Result 10 results
- Languages All
Results 1 - 8 of 8 for MyError (0.47 sec)
-
src/runtime/chanbarrier_test.go
) type response struct { } type myError struct { } func (myError) Error() string { return "" } func doRequest(useSelect bool) (*response, error) { type async struct { resp *response err error } ch := make(chan *async, 0) done := make(chan struct{}, 0) if useSelect { go func() { select { case ch <- &async{resp: nil, err: myError{}}: case <-done: } }() } else {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon May 06 17:50:18 UTC 2024 - 1.4K bytes - Viewed (0) -
src/errors/wrap.go
// // An error type might provide an Is method so it can be treated as equivalent // to an existing error. For example, if MyError defines // // func (m MyError) Is(target error) bool { return target == fs.ErrExist } // // then Is(MyError{}, fs.ErrExist) returns true. See [syscall.Errno.Is] for // an example in the standard library. An Is method should only shallowly
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 24 17:13:04 UTC 2024 - 4.3K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/util/concurrent/FuturesTest.java
ListenableFuture<Object> input = UncheckedThrowingFuture.throwingError(new MyError()); // We'd catch only MyError.class here, but then the test won't compile under GWT. ListenableFuture<Object> output = catching(input, Throwable.class, identity(), directExecutor()); assertThat(getDone(output)).isInstanceOf(MyError.class); } public void testCatching_listenerThrowsError() throws Exception {
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Wed May 29 16:29:37 UTC 2024 - 144.1K bytes - Viewed (0) -
guava-tests/test/com/google/common/util/concurrent/FuturesTest.java
ListenableFuture<Object> input = UncheckedThrowingFuture.throwingError(new MyError()); // We'd catch only MyError.class here, but then the test won't compile under GWT. ListenableFuture<Object> output = catching(input, Throwable.class, identity(), directExecutor()); assertThat(getDone(output)).isInstanceOf(MyError.class); } public void testCatching_listenerThrowsError() throws Exception {
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Wed May 29 16:29:37 UTC 2024 - 144.1K bytes - Viewed (0) -
src/html/template/exec_test.go
v := make([]int, len(b)) for i, x := range b { v[i] = x + a } return v } var myError = errors.New("my error") // MyError returns a value and an error according to its argument. func (t *T) MyError(error bool) (bool, error) { if error { return true, myError } return false, nil } // A few methods to test chaining. func (t *T) GetU() *U { return t.U }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sat Feb 24 21:59:12 UTC 2024 - 57.6K bytes - Viewed (0) -
src/text/template/exec_test.go
v := make([]int, len(b)) for i, x := range b { v[i] = x + a } return v } var myError = errors.New("my error") // MyError returns a value and an error according to its argument. func (t *T) MyError(error bool) (bool, error) { if error { return true, myError } return false, nil } // A few methods to test chaining. func (t *T) GetU() *U { return t.U }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 24 22:23:55 UTC 2024 - 60.1K bytes - Viewed (0) -
src/context/context.go
// Calling cancel with nil sets the cause to Canceled. // // Example use: // // ctx, cancel := context.WithCancelCause(parent) // cancel(myError) // ctx.Err() // returns context.Canceled // context.Cause(ctx) // returns myError func WithCancelCause(parent Context) (ctx Context, cancel CancelCauseFunc) { c := withCancel(parent) return c, func(cause error) { c.cancel(true, Canceled, cause) } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 26 19:58:28 UTC 2024 - 23.7K bytes - Viewed (0) -
src/cmd/compile/internal/staticinit/sched.go
// then we inline the value expressions into the return argument // and then call StaticAssign to handle that copy. // // This handles simple cases like // // var myError = errors.New("mine") // // where errors.New is // // func New(text string) error { // return &errorString{text} // } // // We could make things more sophisticated but this kind of initializer
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 17:16:14 UTC 2024 - 30.7K bytes - Viewed (0)