Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for SetNestedStringMap (0.42 sec)

  1. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/helpers_test.go

    }
    
    func TestSetNestedStringMap(t *testing.T) {
    	obj := map[string]interface{}{
    		"x": map[string]interface{}{
    			"y": 1,
    			"a": "foo",
    		},
    	}
    
    	err := SetNestedStringMap(obj, map[string]string{"b": "bar"}, "x", "z")
    	assert.NoError(t, err)
    	assert.Len(t, obj["x"], 3)
    	assert.Len(t, obj["x"].(map[string]interface{})["z"], 1)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Nov 24 07:53:28 UTC 2021
    - 5.9K bytes
    - Viewed (0)
Back to top