Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for MyError (0.18 sec)

  1. 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)
  2. 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)
  3. 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)
  4. pkg/registry/authorization/subjectaccessreview/rest_test.go

    			err:      errors.New("myerror"),
    			expectedAttrs: authorizer.AttributesRecord{
    				User:            &user.DefaultInfo{Name: "bob"},
    				Verb:            "get",
    				Path:            "/mypath",
    				ResourceRequest: false,
    			},
    			expectedStatus: authorizationapi.SubjectAccessReviewStatus{
    				Allowed:         false,
    				Reason:          "myreason",
    				EvaluationError: "myerror",
    			},
    		},
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Apr 25 16:06:18 UTC 2023
    - 6.3K bytes
    - Viewed (0)
  5. 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)
  6. 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)
Back to top