Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestAnyValue (0.17 sec)

  1. src/log/slog/value_test.go

    	// Because typical Levels are small integers,
    	// they are zero-alloc.
    	var a Value
    	x := LevelDebug + 100
    	wantAllocs(t, 0, func() { a = AnyValue(x) })
    	_ = a
    }
    
    func TestAnyValue(t *testing.T) {
    	for _, test := range []struct {
    		in   any
    		want Value
    	}{
    		{1, IntValue(1)},
    		{1.5, Float64Value(1.5)},
    		{float32(2.5), Float64Value(2.5)},
    		{"s", StringValue("s")},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:12:08 UTC 2024
    - 6.9K bytes
    - Viewed (0)
Back to top