Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for wrapArgs (0.08 sec)

  1. src/fmt/errors.go

    // It is invalid to supply the %w verb with an operand that does not implement
    // the error interface. The %w verb is otherwise a synonym for %v.
    func Errorf(format string, a ...any) error {
    	p := newPrinter()
    	p.wrapErrs = true
    	p.doPrintf(format, a)
    	s := string(p.buf)
    	var err error
    	switch len(p.wrappedErrs) {
    	case 0:
    		err = errors.New(s)
    	case 1:
    		w := &wrapError{msg: s}
    		w.err, _ = a[p.wrappedErrs[0]].(error)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  2. src/fmt/print.go

    	panicking bool
    	// erroring is set when printing an error string to guard against calling handleMethods.
    	erroring bool
    	// wrapErrs is set when the format string may contain a %w verb.
    	wrapErrs bool
    	// wrappedErrs records the targets of the %w verb.
    	wrappedErrs []int
    }
    
    var ppFree = sync.Pool{
    	New: func() any { return new(pp) },
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 21:22:43 UTC 2024
    - 31.8K bytes
    - Viewed (0)
Back to top