- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 14 for MyError (0.12 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) -
test/fixedbugs/issue35739.dir/a.go
// Copyright 2020 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. package a type myError string func (e myError) Error() string { return string(e) } const myErrorVal myError = "error" func IsMyError(err error) bool { return err == error(myErrorVal)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Oct 13 22:50:26 UTC 2020 - 350 bytes - Viewed (0) -
src/errors/example_test.go
package errors_test import ( "errors" "fmt" "io/fs" "os" "time" ) // MyError is an error implementation that includes a time and message. type MyError struct { When time.Time What string } func (e MyError) Error() string { return fmt.Sprintf("%v: %v", e.When, e.What) } func oops() error { return MyError{ time.Date(1989, 3, 15, 22, 30, 0, 0, time.UTC), "the file system has gone away", } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Aug 16 02:08:40 UTC 2023 - 2.2K bytes - Viewed (0) -
pkg/registry/authorization/subjectaccessreview/rest_test.go
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Apr 25 16:06:18 UTC 2023 - 6.3K 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) -
android/guava-tests/test/com/google/common/util/concurrent/SequentialExecutorTest.java
assertEquals(0, numCalls.get()); reject.set(false); executor.execute(task); assertEquals(1, numCalls.get()); } /* * Under Android, MyError propagates up and fails the test? * * TODO(b/218700094): Does this matter to prod users, or is it just a feature of our testing
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Wed Sep 06 17:04:31 UTC 2023 - 11.4K bytes - Viewed (0) -
guava-tests/test/com/google/common/util/concurrent/SequentialExecutorTest.java
assertEquals(0, numCalls.get()); reject.set(false); executor.execute(task); assertEquals(1, numCalls.get()); } /* * Under Android, MyError propagates up and fails the test? * * TODO(b/218700094): Does this matter to prod users, or is it just a feature of our testing
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Wed Sep 06 17:04:31 UTC 2023 - 11.4K 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)