you actully CAN range over nil slices in Go
as Go will just handle it like an empty slice.
This commit is contained in:
parent
faa1c563ea
commit
d06d40e71a
|
@ -47,9 +47,6 @@ func GetChangedGoFiles() (result []string) {
|
|||
absolutePath := GetGitRoot()
|
||||
|
||||
resultLines := strings.Split(gitDiff, "\n")
|
||||
if resultLines == nil {
|
||||
return
|
||||
}
|
||||
for _, filename := range resultLines {
|
||||
if filename != "" && strings.HasSuffix(filename, ".go") {
|
||||
result = append(result, absolutePath+"/"+filename)
|
||||
|
|
Loading…
Reference in New Issue