aboutsummaryrefslogtreecommitdiff
path: root/attribute_entry.go
diff options
context:
space:
mode:
Diffstat (limited to 'attribute_entry.go')
-rw-r--r--attribute_entry.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/attribute_entry.go b/attribute_entry.go
index c1d329f..98db699 100644
--- a/attribute_entry.go
+++ b/attribute_entry.go
@@ -22,11 +22,12 @@ func newAttributeEntry() AttributeEntry {
}
func (entry *AttributeEntry) apply(key, val string) {
- if key[0] == '!' {
+ switch {
+ case key[0] == '!':
delete(*entry, strings.TrimSpace(key[1:]))
- } else if key[len(key)-1] == '!' {
+ case key[len(key)-1] == '!':
delete(*entry, strings.TrimSpace(key[:len(key)-1]))
- } else {
+ default:
(*entry)[key] = val
}
}