Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 159 for Panicf (0.26 sec)

  1. src/cmd/api/main_test.go

    }
    
    func (w *Walker) emitf(format string, args ...any) {
    	f := strings.Join(w.scope, ", ") + ", " + fmt.Sprintf(format, args...)
    	if strings.Contains(f, "\n") {
    		panic("feature contains newlines: " + f)
    	}
    
    	if _, dup := w.features[f]; dup {
    		panic("duplicate feature inserted: " + f)
    	}
    	w.features[f] = true
    
    	if verbose {
    		log.Printf("feature: %s", f)
    	}
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Apr 09 20:48:51 GMT 2024
    - 31.4K bytes
    - Viewed (0)
  2. src/bytes/buffer.go

    // another n bytes. After Grow(n), at least n bytes can be written to the
    // buffer without another allocation.
    // If n is negative, Grow will panic.
    // If the buffer can't grow it will panic with [ErrTooLarge].
    func (b *Buffer) Grow(n int) {
    	if n < 0 {
    		panic("bytes.Buffer.Grow: negative count")
    	}
    	m := b.grow(n)
    	b.buf = b.buf[:m]
    }
    
    // Write appends the contents of p to the buffer, growing the buffer as
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 17:10:31 GMT 2023
    - 15.7K bytes
    - Viewed (0)
  3. cmd/metrics-v3-types.go

    // descriptors, this function panics.
    //
    // Panics if `labels` is not a list of ordered label name and label value pairs
    // or if all labels for the metric are not provided.
    func (m *MetricValues) Set(name MetricName, value float64, labels ...string) {
    	desc, ok := m.descriptors[name]
    	if !ok {
    		panic(fmt.Sprintf("metric has no description: %s", name))
    	}
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Mar 10 09:15:15 GMT 2024
    - 14.6K bytes
    - Viewed (0)
  4. src/bufio/scan.go

    //
    // Buffer panics if it is called after scanning has started.
    func (s *Scanner) Buffer(buf []byte, max int) {
    	if s.scanCalled {
    		panic("Buffer called after Scan")
    	}
    	s.buf = buf[0:cap(buf)]
    	s.maxTokenSize = max
    }
    
    // Split sets the split function for the [Scanner].
    // The default split function is [ScanLines].
    //
    // Split panics if it is called after scanning has started.
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Oct 23 09:06:30 GMT 2023
    - 14.2K bytes
    - Viewed (0)
  5. doc/go1.17_spec.html

    </pre>
    
    <h3 id="Handling_panics">Handling panics</h3>
    
    <p> Two built-in functions, <code>panic</code> and <code>recover</code>,
    assist in reporting and handling <a href="#Run_time_panics">run-time panics</a>
    and program-defined error conditions.
    </p>
    
    <pre class="grammar">
    func panic(interface{})
    func recover() interface{}
    </pre>
    
    <p>
    HTML
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Apr 11 20:22:45 GMT 2024
    - 211.6K bytes
    - Viewed (0)
  6. src/bytes/buffer_test.go

    	}
    }
    
    type panicReader struct{ panic bool }
    
    func (r panicReader) Read(p []byte) (int, error) {
    	if r.panic {
    		panic("oops")
    	}
    	return 0, io.EOF
    }
    
    // Make sure that an empty Buffer remains empty when
    // it is "grown" before a Read that panics
    func TestReadFromPanicReader(t *testing.T) {
    
    	// First verify non-panic behaviour
    	var buf Buffer
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Apr 26 13:31:36 GMT 2024
    - 18.6K bytes
    - Viewed (0)
  7. doc/go_spec.html

    of the location.
    </p>
    
    
    <h3 id="Handling_panics">Handling panics</h3>
    
    <p> Two built-in functions, <code>panic</code> and <code>recover</code>,
    assist in reporting and handling <a href="#Run_time_panics">run-time panics</a>
    and program-defined error conditions.
    </p>
    
    <pre class="grammar">
    func panic(interface{})
    func recover() interface{}
    </pre>
    
    <p>
    HTML
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Apr 26 00:39:16 GMT 2024
    - 279.6K bytes
    - Viewed (0)
  8. src/bufio/bufio.go

    	if b.r > 0 {
    		copy(b.buf, b.buf[b.r:b.w])
    		b.w -= b.r
    		b.r = 0
    	}
    
    	if b.w >= len(b.buf) {
    		panic("bufio: tried to fill full buffer")
    	}
    
    	// Read new data: try a limited number of times.
    	for i := maxConsecutiveEmptyReads; i > 0; i-- {
    		n, err := b.rd.Read(b.buf[b.w:])
    		if n < 0 {
    			panic(errNegativeRead)
    		}
    		b.w += n
    		if err != nil {
    			b.err = err
    			return
    		}
    		if n > 0 {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Oct 12 14:39:08 GMT 2023
    - 21.8K bytes
    - Viewed (0)
  9. cni/pkg/nodeagent/ztunnelserver_test.go

    	ztun, err := newZtunnelServer(addr, pods)
    	if err != nil {
    		panic(err)
    	}
    	go ztun.Run(ctx)
    
    	// now as a client connect confirm we and get snapshot
    	resolvedAddr, err := net.ResolveUnixAddr("unixpacket", addr)
    	if err != nil {
    		panic(err)
    	}
    	ztunClient, err := net.DialUnix("unixpacket", nil, resolvedAddr)
    	if err != nil {
    		panic(err)
    	}
    
    	// send hello
    	sendHello(ztunClient)
    
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 8.6K bytes
    - Viewed (0)
  10. cmd/generic-handlers.go

    		if globalLocalNodeName != "" {
    			w.Header().Set(xhttp.AmzRequestHostID, globalLocalNodeNameHex)
    		}
    		h.ServeHTTP(w, r)
    	})
    }
    
    // criticalErrorHandler handles panics and fatal errors by
    // `panic(logger.ErrCritical)` as done by `logger.CriticalIf`.
    //
    // It should be always the first / highest HTTP handler.
    func setCriticalErrorHandler(h http.Handler) http.Handler {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 11 01:08:52 GMT 2024
    - 20.7K bytes
    - Viewed (0)
Back to top