utils library for golang
Перейти к файлу
softlandia eed16b3005 v0.0.3 2019-11-27 00:06:36 +04:00
test_files v0.0.3 2019-11-27 00:06:36 +04:00
.gitignore 0.0.1 2019-08-14 18:55:02 +04:00
README.md v0.0.3 2019-11-27 00:06:36 +04:00
cover.html 0.0.1 2019-08-14 18:55:02 +04:00
cover.out 0.0.1 2019-08-14 18:55:02 +04:00
res.dat v0.0.3 2019-11-27 00:06:36 +04:00
utils.go 0.0.2 add code page id 2019-08-19 03:58:01 +04:00
xFileUtil.go v0.0.3 2019-11-27 00:06:36 +04:00
xFileUtil_test.go v0.0.3 2019-11-27 00:06:36 +04:00
xStrUtil.go v0.0.3 2019-11-27 00:06:36 +04:00
xStrUtil_test.go v0.0.3 2019-11-27 00:06:36 +04:00

README.md

golang util library

(c) softlandia@gmail.com

download: go get -u github.com/softlandia/xLib
install: go install

dependences

"golang.org/x/text/encoding/charmap"
"golang.org/x/text/transform"

functions

  1. FileExists(name string) bool
  2. StrContainBackSlash(s string) bool
  3. StrIsPrintRune(s string) bool
  4. ChangeFileExt(iFileName, newExt string) string
  5. SeekFileToString(fileName, strToSearch string) (*bufio.Scanner, error)
  6. 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