From 6e2090b23db2083b7102d04a8501581f0548fa64 Mon Sep 17 00:00:00 2001 From: "Thomas M. Edwards" Date: Mon, 24 Feb 2020 16:08:26 -0600 Subject: [PATCH] [Update] Golint appeasement. --- filesystem.go | 6 +++--- sort.go | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/filesystem.go b/filesystem.go index 40975c0..4717ee8 100644 --- a/filesystem.go +++ b/filesystem.go @@ -33,7 +33,7 @@ func init() { } } -var noOutToIn = fmt.Errorf("no output to input source") +var errNoOutToIn = fmt.Errorf("no output to input source") // Walk the specified pathnames, collecting regular files. func getFilenames(pathnames []string, outFilename string) []string { @@ -55,7 +55,7 @@ func getFilenames(pathnames []string, outFilename string) []string { return err } if absolute == absOutFile { - return noOutToIn + return errNoOutToIn } relative, _ := filepath.Rel(workingDir, absolute) // Failure is okay. if relative != "" { @@ -77,7 +77,7 @@ func getFilenames(pathnames []string, outFilename string) []string { log.Print("warning: path -: Reading from standard input is unsupported.") continue } else if err := filepath.Walk(pathname, fileWalker); err != nil { - if err == noOutToIn { + if err == errNoOutToIn { log.Fatalf("error: path %s: Output file cannot be an input source.", pathname) } else { log.Printf("warning: path %s: %s", pathname, err.Error()) diff --git a/sort.go b/sort.go index 60c0881..b947443 100644 --- a/sort.go +++ b/sort.go @@ -10,6 +10,7 @@ import ( "unicode" ) +// StringsInsensitively provides for case insensitively sorting slices of strings. type StringsInsensitively []string func (p StringsInsensitively) Len() int {