Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestMarshalErrorAndReuseEncodeState (0.53 sec)

  1. src/encoding/json/encode_test.go

    	type Foo struct {
    		N Number
    	}
    	x := Foo{Number(`invalid`)}
    
    	if _, err := Marshal(&x); err == nil {
    		t.Fatalf("Marshal error: got nil, want non-nil")
    	}
    }
    
    func TestMarshalErrorAndReuseEncodeState(t *testing.T) {
    	// Disable the GC temporarily to prevent encodeState's in Pool being cleaned away during the test.
    	percent := debug.SetGCPercent(-1)
    	defer debug.SetGCPercent(percent)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 29.4K bytes
    - Viewed (0)
Back to top