Skip to content
This repository has been archived by the owner on Feb 26, 2019. It is now read-only.

Commit

Permalink
Replace simple == with strings.EqualFold
Browse files Browse the repository at this point in the history
In listFiles I added a check to ensure that godep only processes files
in the current directory. This check was unfortunately a byte by byte
check, not a case insensitive check. With case insensitive filesystems
"Code" == "code".

So replace that with a strings.EqualFold()
  • Loading branch information
Edward Muller committed Feb 23, 2016
1 parent 6a7df2a commit 02ae3f7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Unreleased

# v55 2016/02/22

* re-saved deps to clean out extra stuff (see v54; godep restore; godep save -r=false; rm -rf Godeps; godep save -r). We're still using a workspace with rewrites so users of older go version can still go get this tool.
* Replace simple == with strings.EqualFold in listFiles to avoid problems with case insensitive filesystems ("Code" != "code" when doing a byte by byte comparison)

# v54 2016/02/22

Expand Down
2 changes: 1 addition & 1 deletion vcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (v *VCS) listFiles(dir string) vcsFiles {
panic(err) // this should not happen
}

if filepath.Dir(path) == dir {
if strings.EqualFold(filepath.Dir(path), dir) {
files[path] = true
}
}
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"runtime"
)

const version = 54
const version = 55

var cmdVersion = &Command{
Name: "version",
Expand Down

0 comments on commit 02ae3f7

Please sign in to comment.