MCPcopy
hub / github.com/getsops/sops / Unset

Method Unset

sops.go:292–298  ·  view source on GitHub ↗

Unset removes a value on a given tree from the specified path

(path []interface{})

Source from the content-addressed store, hash-verified

290
291// Unset removes a value on a given tree from the specified path
292func (branch TreeBranch) Unset(path []interface{}) (TreeBranch, error) {
293 v, err := unset(branch, path)
294 if err != nil {
295 return nil, err
296 }
297 return v.(TreeBranch), nil
298}
299
300// Tree is the data structure used by sops to represent documents internally
301type Tree struct {

Callers 14

TestUnsetKeyRootLeafFunction · 0.95
TestUnsetKeyBranchLeafFunction · 0.95
TestUnsetKeyBranchFunction · 0.95
TestUnsetKeyRootLastLeafFunction · 0.95
TestUnsetKeyArrayFunction · 0.95
TestUnsetArrayItemFunction · 0.95
TestUnsetKeyInArrayItemFunction · 0.95
TestUnsetArrayLastItemFunction · 0.95
TestUnsetKeyNotFoundFunction · 0.95

Calls 1

unsetFunction · 0.70

Tested by 13

TestUnsetKeyRootLeafFunction · 0.76
TestUnsetKeyBranchLeafFunction · 0.76
TestUnsetKeyBranchFunction · 0.76
TestUnsetKeyRootLastLeafFunction · 0.76
TestUnsetKeyArrayFunction · 0.76
TestUnsetArrayItemFunction · 0.76
TestUnsetKeyInArrayItemFunction · 0.76
TestUnsetArrayLastItemFunction · 0.76
TestUnsetKeyNotFoundFunction · 0.76