Skip to content

Commit

Permalink
Ignore any symlinks detected
Browse files Browse the repository at this point in the history
Signed-off-by: Liam White <[email protected]>
  • Loading branch information
liamawhite committed Jun 26, 2019
1 parent a35a8cc commit 649fc3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/file/mutator.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,13 @@ func identifyLanguageStyle(path string) *languageStyle {
func getFileContents(path string) []byte {
f, err := os.Open(path)
if err != nil {
fmt.Fprintf(os.Stderr, "unable to open %v", path)
fmt.Fprintf(os.Stderr, "unable to open %v\n", path)
}

// This will be an issue with really large files...
contents, err := ioutil.ReadAll(f)
if err != nil {
fmt.Fprintf(os.Stderr, "unable to read file %v", path)
fmt.Fprintf(os.Stderr, "unable to read file %v\n", path)
}
return contents
}
2 changes: 1 addition & 1 deletion pkg/processor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (p *processor) visit(path string, f os.FileInfo, err error) error {
if shouldSkip(path) {
return nil
}
if !f.IsDir() {
if f.Mode().IsRegular() {
p.wg.Add(1)
go func(path string) {
if !p.visitFunc(path, p.dryRun) {
Expand Down

0 comments on commit 649fc3c

Please sign in to comment.