зеркало из https://github.com/softlandia/xlib.git
eed16b3005 | ||
---|---|---|
test_files | ||
.gitignore | ||
README.md | ||
cover.html | ||
cover.out | ||
res.dat | ||
utils.go | ||
xFileUtil.go | ||
xFileUtil_test.go | ||
xStrUtil.go | ||
xStrUtil_test.go |
README.md
golang util library
download: go get -u github.com/softlandia/xLib
install: go install
dependences
"golang.org/x/text/encoding/charmap"
"golang.org/x/text/transform"
functions
- FileExists(name string) bool
- StrContainBackSlash(s string) bool
- StrIsPrintRune(s string) bool
- ChangeFileExt(iFileName, newExt string) string
- SeekFileToString(fileName, strToSearch string) (*bufio.Scanner, error)
- FindFilesExt(fileList *[]string, path, fileNameExt string) (int, error)
description
func FileExists(name string) bool //return true if file exist
func StrContainBackSlash(s string) bool //return true if string s consist rune back slash '\'
func StrIsPrintRune(s string) bool //return true if input string consists only of printable rune
func ChangeFileExt(iFileName, newExt string) string //return file name with new extention
func SeekFileToString(fileName, strToSearch string) (*bufio.Scanner, error) //read text file fileName and return Scanner at line strToSearch
func FindFilesExt(fileList *[]string, path, fileNameExt string) (int, error) //search in path files with extention == fileNameExt and put file name to slice fileList
tests
coverage 96.2%
folder "test_files" contain files for testing, no remove/change/add