you actully CAN range over nil slices in Go

as Go will just handle it like an empty slice.
This commit is contained in:
Ingo Oeser 2015-08-22 22:55:05 +02:00
parent faa1c563ea
commit d06d40e71a

View File

@ -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)