wdir method moved to utils
This commit is contained in:
parent
b972d0df04
commit
d00b437295
|
@ -76,13 +76,6 @@ func random(n int) string {
|
|||
return string(b)
|
||||
}
|
||||
|
||||
// Wdir return the current working directory
|
||||
func (s Settings) wdir() string {
|
||||
dir, err := os.Getwd()
|
||||
s.validate(err)
|
||||
return filepath.Base(dir)
|
||||
}
|
||||
|
||||
// Flimit defines the max number of watched files
|
||||
func (s *Settings) flimit() error {
|
||||
var rLimit syscall.Rlimit
|
||||
|
|
10
utils.go
10
utils.go
|
@ -6,6 +6,7 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"log"
|
||||
)
|
||||
|
||||
// getEnvPath returns the first path found in env or empty string
|
||||
|
@ -83,3 +84,12 @@ func replace(a []string, b string) []string {
|
|||
}
|
||||
return a
|
||||
}
|
||||
|
||||
// Wdir return current working directory
|
||||
func wdir() string {
|
||||
dir, err := os.Getwd()
|
||||
if err != nil {
|
||||
log.Fatal(prefix(err.Error()))
|
||||
}
|
||||
return dir
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue