mirror of
https://github.com/tmedwards/tweego.git
synced 2025-07-04 21:50:33 -04:00
[Update] Golint appeasement.
This commit is contained in:
parent
0309c003e7
commit
6e2090b23d
2 changed files with 4 additions and 3 deletions
|
@ -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.
|
// Walk the specified pathnames, collecting regular files.
|
||||||
func getFilenames(pathnames []string, outFilename string) []string {
|
func getFilenames(pathnames []string, outFilename string) []string {
|
||||||
|
@ -55,7 +55,7 @@ func getFilenames(pathnames []string, outFilename string) []string {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if absolute == absOutFile {
|
if absolute == absOutFile {
|
||||||
return noOutToIn
|
return errNoOutToIn
|
||||||
}
|
}
|
||||||
relative, _ := filepath.Rel(workingDir, absolute) // Failure is okay.
|
relative, _ := filepath.Rel(workingDir, absolute) // Failure is okay.
|
||||||
if relative != "" {
|
if relative != "" {
|
||||||
|
@ -77,7 +77,7 @@ func getFilenames(pathnames []string, outFilename string) []string {
|
||||||
log.Print("warning: path -: Reading from standard input is unsupported.")
|
log.Print("warning: path -: Reading from standard input is unsupported.")
|
||||||
continue
|
continue
|
||||||
} else if err := filepath.Walk(pathname, fileWalker); err != nil {
|
} 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)
|
log.Fatalf("error: path %s: Output file cannot be an input source.", pathname)
|
||||||
} else {
|
} else {
|
||||||
log.Printf("warning: path %s: %s", pathname, err.Error())
|
log.Printf("warning: path %s: %s", pathname, err.Error())
|
||||||
|
|
1
sort.go
1
sort.go
|
@ -10,6 +10,7 @@ import (
|
||||||
"unicode"
|
"unicode"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// StringsInsensitively provides for case insensitively sorting slices of strings.
|
||||||
type StringsInsensitively []string
|
type StringsInsensitively []string
|
||||||
|
|
||||||
func (p StringsInsensitively) Len() int {
|
func (p StringsInsensitively) Len() int {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue