MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / Delete

Method Delete

xmlparser/attributes.go:79–93  ·  view source on GitHub ↗

Delete removes the attribute with the given name.

(name Name)

Source from the content-addressed store, hash-verified

77
78// Delete removes the attribute with the given name.
79func (a *Attributes) Delete(name Name) {
80 // If attribute does not exist, nothing to do
81 attr, exists := a.m[name]
82 if !exists {
83 return
84 }
85
86 // Remove from map
87 delete(a.m, name)
88
89 // Remove from slice
90 if idx := slices.Index(a.s, attr); idx != -1 {
91 a.s = slices.Delete(a.s, idx, idx+1)
92 }
93}
94
95// DeleteByString is like Delete but accepts a string name.
96func (a *Attributes) DeleteByString(name string) {

Callers 1

DeleteByStringMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected