Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 469 for sloc (0.06 sec)

  1. src/log/slog/slogtest_test.go

    	"encoding/json"
    	"fmt"
    	"io"
    	"log/slog"
    	"strings"
    	"testing"
    	"testing/slogtest"
    )
    
    func TestSlogtest(t *testing.T) {
    	for _, test := range []struct {
    		name  string
    		new   func(io.Writer) slog.Handler
    		parse func([]byte) (map[string]any, error)
    	}{
    		{"JSON", func(w io.Writer) slog.Handler { return slog.NewJSONHandler(w, nil) }, parseJSON},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 10 12:50:22 UTC 2023
    - 2.6K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/ssa/shortcircuit_test.go

    			Goto("b3")),
    		Bloc("b3",
    			Valu("phi2", OpPhi, c.config.Types.Bool, 0, nil, "cmp1", "cmp2"),
    			If("phi2", "b4", "b5")),
    		Bloc("b4",
    			Valu("cmp3", OpLess64, c.config.Types.Bool, 0, nil, "arg3", "arg1"),
    			Goto("b5")),
    		Bloc("b5",
    			Valu("phi3", OpPhi, c.config.Types.Bool, 0, nil, "phi2", "cmp3"),
    			If("phi3", "b6", "b7")),
    		Bloc("b6",
    			Exit("mem")),
    		Bloc("b7",
    			Exit("mem")))
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 09 23:01:51 UTC 2017
    - 1.3K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/ssa/deadstore_test.go

    	c := testConfig(t)
    	ptrType := c.config.Types.BytePtr
    	fun := c.Fun("entry",
    		Bloc("entry",
    			Valu("start", OpInitMem, types.TypeMem, 0, nil),
    			Valu("sb", OpSB, c.config.Types.Uintptr, 0, nil),
    			Valu("v", OpConstBool, c.config.Types.Bool, 1, nil),
    			Valu("addr", OpAddr, ptrType, 0, nil, "sb"),
    			Goto("loop")),
    		Bloc("loop",
    			Valu("phi", OpPhi, types.TypeMem, 0, nil, "start", "store"),
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 25 20:07:26 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  4. src/internal/coverage/pkid.go

    //    registered list:
    //    slot: 0 path='internal/cpu'  hard-coded id: 1
    //    slot: 1 path='internal/goarch'  hard-coded id: 2
    //    slot: 2 path='internal/runtime/atomic'  hard-coded id: 3
    //    slot: 3 path='internal/goos'
    //    slot: 4 path='runtime/internal/sys'  hard-coded id: 5
    //    slot: 5 path='internal/abi'  hard-coded id: 4
    //    slot: 6 path='runtime/internal/math'  hard-coded id: 6
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  5. src/log/slog/example_logvaluer_secret_test.go

    // license that can be found in the LICENSE file.
    
    package slog_test
    
    import (
    	"log/slog"
    	"log/slog/internal/slogtest"
    	"os"
    )
    
    // A token is a secret value that grants permissions.
    type Token string
    
    // LogValue implements slog.LogValuer.
    // It avoids revealing the token.
    func (Token) LogValue() slog.Value {
    	return slog.StringValue("REDACTED_TOKEN")
    }
    
    // This example demonstrates a Value that replaces itself
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 04 18:32:54 UTC 2023
    - 906 bytes
    - Viewed (0)
  6. src/testing/slogtest/run_test.go

    // license that can be found in the LICENSE file.
    
    package slogtest_test
    
    import (
    	"bytes"
    	"encoding/json"
    	"log/slog"
    	"testing"
    	"testing/slogtest"
    )
    
    func TestRun(t *testing.T) {
    	var buf bytes.Buffer
    
    	newHandler := func(*testing.T) slog.Handler {
    		buf.Reset()
    		return slog.NewJSONHandler(&buf, nil)
    	}
    	result := func(t *testing.T) map[string]any {
    		m := map[string]any{}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 20:37:12 UTC 2023
    - 623 bytes
    - Viewed (0)
  7. src/log/slog/example_logvaluer_group_test.go

    package slog_test
    
    import "log/slog"
    
    type Name struct {
    	First, Last string
    }
    
    // LogValue implements slog.LogValuer.
    // It returns a group containing the fields of
    // the Name, so that they appear together in the log output.
    func (n Name) LogValue() slog.Value {
    	return slog.GroupValue(
    		slog.String("first", n.First),
    		slog.String("last", n.Last))
    }
    
    func ExampleLogValuer_group() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 21 20:55:33 UTC 2023
    - 825 bytes
    - Viewed (0)
  8. src/sync/poolqueue.go

    		// reading the value to take back ownership of this
    		// slot.
    		head--
    		ptrs2 := d.pack(head, tail)
    		if d.headTail.CompareAndSwap(ptrs, ptrs2) {
    			// We successfully took back slot.
    			slot = &d.vals[head&uint32(len(d.vals)-1)]
    			break
    		}
    	}
    
    	val := *(*any)(unsafe.Pointer(slot))
    	if val == dequeueNil(nil) {
    		val = nil
    	}
    	// Zero the slot. Unlike popTail, this isn't racing with
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 18:12:29 UTC 2024
    - 8.3K bytes
    - Viewed (0)
  9. test/fixedbugs/issue19078.go

    	u += 1<<13 - 1                  // add almost a page
    
    	for i := 0; i < 1000000; i++ {
    		_ = identity(u)         // installs u at return slot
    		_ = liveReturnSlot(nil) // incorrectly marks return slot as live
    	}
    }
    
    //go:noinline
    func liveReturnSlot(x *int) *int {
    	defer func() {}() // causes return slot to be marked live
    	sink = &x         // causes x to be moved to the heap, triggering allocation
    	return x
    }
    
    //go:noinline
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 13 19:39:15 UTC 2017
    - 1.2K bytes
    - Viewed (0)
  10. src/internal/bytealg/index_amd64.go

    // before switching over to Index.
    // n is the number of bytes processed so far.
    // See the bytes.Index implementation for details.
    func Cutover(n int) int {
    	// 1 error per 8 characters, plus a few slop to start.
    	return (n + 16) / 8
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Mar 04 19:49:44 UTC 2018
    - 617 bytes
    - Viewed (0)
Back to top