- Sort Score
- Result 10 results
- Languages All
Results 11 - 14 of 14 for MyError (0.08 sec)
-
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) -
test/noinit.go
var LitSCallXInit = FS(7, 8, 9) var LitSAnyCallXInit any = FSA(10, 11, 12) var LitSRepeat = F3(1 + 2) func F0() *S { return &S{1, 2, 3} } var LitSNoArgs = F0() var myError = errors.New("mine") func gopherize(s string) string { return "gopher gopher gopher " + s } var animals = gopherize("badger") // These init funcs should optimize away. func init() { }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 14 17:57:36 UTC 2023 - 6.8K 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)