mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-17 05:48:21 +00:00
pkg/apis/nfd: drop unnecessary else statements
This commit is contained in:
parent
3f225be081
commit
1765a37c6a
2 changed files with 7 additions and 9 deletions
|
@ -443,7 +443,7 @@ func (m *MatchExpressionSet) UnmarshalJSON(data []byte) error {
|
||||||
expressions := make(map[string]*MatchExpression)
|
expressions := make(map[string]*MatchExpression)
|
||||||
if err := json.Unmarshal(data, &expressions); err != nil {
|
if err := json.Unmarshal(data, &expressions); err != nil {
|
||||||
return err
|
return err
|
||||||
} else {
|
}
|
||||||
for k, v := range expressions {
|
for k, v := range expressions {
|
||||||
if v != nil {
|
if v != nil {
|
||||||
(*m).Expressions[k] = v
|
(*m).Expressions[k] = v
|
||||||
|
@ -452,7 +452,6 @@ func (m *MatchExpressionSet) UnmarshalJSON(data []byte) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -257,9 +257,8 @@ func (h *templateHelper) expandMap(data interface{}) (map[string]string, error)
|
||||||
split := strings.SplitN(trimmed, "=", 2)
|
split := strings.SplitN(trimmed, "=", 2)
|
||||||
if len(split) == 1 {
|
if len(split) == 1 {
|
||||||
return nil, fmt.Errorf("missing value in expanded template line %q, (format must be '<key>=<value>')", trimmed)
|
return nil, fmt.Errorf("missing value in expanded template line %q, (format must be '<key>=<value>')", trimmed)
|
||||||
} else {
|
|
||||||
out[split[0]] = split[1]
|
|
||||||
}
|
}
|
||||||
|
out[split[0]] = split[1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
|
|
Loading…
Add table
Reference in a new issue