Skip to content

Commit

Permalink
fix: Find actual index, otherwise it was 0 previously for all cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Marvin9 committed Sep 16, 2020
1 parent 83566b1 commit a0d87c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion steps/iterate_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@ func (m *CommandModel) iterateDirectory(path string) {
}

content := buffer[:read]
fileContentBeforeAppend := len(fileContent)
fileContent = append(fileContent, content...)

if licenseAlreadyExist == -1 {
exist := bytes.Index(content, uniqueHeader)
if exist != -1 {
licenseAlreadyExist = exist
licenseAlreadyExist = exist + fileContentBeforeAppend
}
}

Expand Down

0 comments on commit a0d87c3

Please sign in to comment.