MCPcopy Index your code
hub / github.com/getsops/sops / TestUnsetKeyArray

Function TestUnsetKeyArray

sops_test.go:1310–1337  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1308}
1309
1310func TestUnsetKeyArray(t *testing.T) {
1311 branch := TreeBranch{
1312 TreeItem{
1313 Key: "foo",
1314 Value: TreeBranch{
1315 TreeItem{
1316 Key: "bar",
1317 Value: []interface{}{
1318 TreeBranch{
1319 TreeItem{
1320 Key: "baz",
1321 Value: "baz",
1322 },
1323 },
1324 },
1325 },
1326 },
1327 },
1328 }
1329 unset, err := branch.Unset([]interface{}{"foo", "bar"})
1330 assert.NoError(t, err)
1331 assert.Equal(t, TreeBranch{
1332 TreeItem{
1333 Key: "foo",
1334 Value: TreeBranch{},
1335 },
1336 }, unset)
1337}
1338
1339func TestUnsetArrayItem(t *testing.T) {
1340 branch := TreeBranch{

Callers

nothing calls this directly

Calls 1

UnsetMethod · 0.95

Tested by

no test coverage detected