- Sort Score
- Result 10 results
- Languages All
Results 41 - 50 of 326 for perror (0.2 sec)
-
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/encoding/json/decode_test.go
CaseName dest any in string }{ {Name(""), new(string), `{"user": "name"}`}, // issue 4628. {Name(""), new(error), `{}`}, // issue 4222 {Name(""), new(error), `[]`}, {Name(""), new(error), `""`}, {Name(""), new(error), `123`}, {Name(""), new(error), `true`}, } for _, tt := range tests { t.Run(tt.Name, func(t *testing.T) { err := Unmarshal([]byte(tt.in), tt.dest)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Apr 11 16:40:14 UTC 2024 - 67.6K bytes - Viewed (0) -
src/os/os_test.go
if err != nil { // We look at error strings as the // expected errors are OS-specific. switch { case errors.Is(err, ErrClosed), strings.Contains(err.Error(), "broken pipe"), strings.Contains(err.Error(), "pipe is being closed"), strings.Contains(err.Error(), "hungup channel"): // Ignore an expected error. default: // Unexpected error. t.Error(err) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 83.1K bytes - Viewed (0) -
staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go
_, err = result.Infos() } if len(tc.expectedError) == 0 { if err != nil { t.Errorf("unexpected error: %v", err) } } else { if err == nil { t.Errorf("expected error, got none") } else if !strings.Contains(err.Error(), tc.expectedError) { t.Errorf("expected error with '%s', got: %v", tc.expectedError, err) } } }) } }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon May 01 11:58:41 UTC 2023 - 56.1K bytes - Viewed (0) -
src/crypto/tls/handshake_client_test.go
err := client.Handshake() if err != nil { if err, ok := err.(net.Error); ok && err.Timeout() { t.Errorf("Expected a closed network connection error but got '%s'", err.Error()) } } else { t.Errorf("Error expected, but no error returned") } } func testDowngradeCanary(t *testing.T, clientVersion, serverVersion uint16) error { defer func() { testingOnlyForceDowngradeCanary = false }()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 03:10:12 UTC 2024 - 88.7K bytes - Viewed (0) -
src/go/types/expr.go
// Report the error on the 2nd operand since we only // know after seeing the 2nd operand whether we have // an invalid comparison. errOp = y goto Error } case !Comparable(x.typ): errOp = x cause = check.incomparableCause(x.typ) goto Error case !Comparable(y.typ): errOp = y cause = check.incomparableCause(y.typ) goto Error
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 29 02:09:54 UTC 2024 - 49.7K bytes - Viewed (0) -
cmd/object-api-multipart_test.go
if testCase.expectedError.Error() != actualErr.Error() { t.Errorf("Test %d: %s: Expected to fail with error \"%s\", but instead failed with error \"%s\" instead.", i+1, instanceType, testCase.expectedError.Error(), actualErr.Error()) } } // Test passes as expected, but the output values are verified for correctness here. if actualErr == nil && testCase.shouldPass {
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Thu Feb 22 06:26:06 UTC 2024 - 77.1K bytes - Viewed (0) -
cmd/erasure-server-pool.go
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Thu May 30 11:58:12 UTC 2024 - 82.5K bytes - Viewed (0) -
src/cmd/compile/internal/types2/expr.go
goto Error } if isTypeParam(x.typ) { check.errorf(x, InvalidAssert, invalidOp+"cannot use type assertion on type parameter value %s", x) goto Error } if _, ok := under(x.typ).(*Interface); !ok { check.errorf(x, InvalidAssert, invalidOp+"%s is not an interface", x) goto Error } T := check.varType(e.Type) if !isValid(T) { goto Error } check.typeAssertion(e, x, T, false)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 29 02:09:54 UTC 2024 - 51.7K bytes - Viewed (0) -
tests/migrate_test.go
if err := DB.Exec(sql).Error; err != nil { t.Errorf("Failed, got error: %v", err) } session := DB.Session(&gorm.Session{Logger: Tracer{ Logger: DB.Config.Logger, Test: func(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error) { sql, _ := fc() if strings.HasPrefix(sql, "ALTER TABLE") { t.Errorf("shouldn't execute: sql=%s", sql) } },
Registered: Wed Jun 12 16:27:09 UTC 2024 - Last Modified: Mon Mar 18 11:24:16 UTC 2024 - 56.2K bytes - Viewed (0)