Skip to content

Commit

Permalink
Merge pull request #1293 from marquiz/devel/feature-file-whitespace
Browse files Browse the repository at this point in the history
source/local: trim whitespace from input
  • Loading branch information
k8s-ci-robot committed Aug 4, 2023
2 parents 1fa4178 + 181b4e0 commit 6d30ca9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,10 @@ func (s *localSource) GetFeatures() *nfdv1alpha1.Features {
func parseFeatures(lines [][]byte) map[string]string {
features := make(map[string]string)

for _, line := range lines {
for _, l := range lines {
line := strings.TrimSpace(string(l))
if len(line) > 0 {
lineSplit := strings.SplitN(string(line), "=", 2)
lineSplit := strings.SplitN(line, "=", 2)

key := lineSplit[0]

Expand Down

0 comments on commit 6d30ca9

Please sign in to comment.