Skip to content

Commit

Permalink
Change header_count variable naming to camel case
Browse files Browse the repository at this point in the history
  • Loading branch information
Micah-Kolide committed Mar 1, 2024
1 parent 4825485 commit 722856e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ee/dataflatten/string_delimited.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,23 @@ func StringDelimitedLineFunc(sep string, headers []string, skipN int) dataFunc {
}
}

header_count := len(headers)
headerCount := len(headers)

for scanner.Scan() {
line := scanner.Text()

// headers weren't provided, so retrieve them from the first available line.
if header_count == 0 {
headers = lineSplit(sep, line, header_count)
header_count = len(headers)
if headerCount == 0 {
headers = lineSplit(sep, line, headerCount)
headerCount = len(headers)
continue
}

row := map[string]interface{}{}
fields := lineSplit(sep, line, header_count)
fields := lineSplit(sep, line, headerCount)
// It's possible we don't have the same number of fields to headers, so use
// min here to avoid a possible array out-of-bounds exception.
min := min(header_count, len(fields))
min := min(headerCount, len(fields))

// For each header, add the corresponding line field to the result row.
for c := 0; c < min; c++ {
Expand Down

0 comments on commit 722856e

Please sign in to comment.