xlib/README.md

41 строка
1.3 KiB
Markdown
Исходник Обычный вид История

2019-04-04 01:28:13 +03:00
# golang util library #
2018-12-15 20:48:08 +03:00
2019-01-21 02:17:20 +03:00
(c) softlandia@gmail.com
2019-04-07 00:01:00 +03:00
>download: go get -u github.com/softlandia/xLib
2019-04-07 00:00:30 +03:00
>install: go install
2018-12-15 20:48:08 +03:00
2019-04-04 01:28:13 +03:00
## dependences ##
2019-01-21 02:17:20 +03:00
2019-01-29 01:05:41 +03:00
>"golang.org/x/text/encoding/charmap"
2019-01-21 02:17:20 +03:00
>"golang.org/x/text/transform"
2019-04-04 01:28:13 +03:00
## functions ##
2019-01-21 02:17:20 +03:00
2018-12-15 20:48:08 +03:00
1. FileExists(name string) bool
2. StrContainBackSlash(s string) bool
3. StrIsPrintRune(s string) bool
4. ChangeFileExt(iFileName, newExt string) string
2019-01-14 19:53:25 +03:00
5. SeekFileToString(fileName, strToSearch string) (*bufio.Scanner, error)
2019-04-04 01:38:17 +03:00
8. FindFilesExt(fileList *[]string, path, fileNameExt string) (int, error)
2019-01-14 19:53:25 +03:00
2019-04-04 01:28:13 +03:00
## description ##
2018-12-15 20:48:08 +03:00
2019-04-06 23:59:01 +03:00
func FileExists(name string) bool //return true if file exist
2018-12-15 20:48:08 +03:00
2019-04-06 23:59:01 +03:00
func StrContainBackSlash(s string) bool //return true if string s consist rune back slash '\'
2018-12-15 20:48:08 +03:00
2019-04-06 23:59:01 +03:00
func StrIsPrintRune(s string) bool //return true if input string consists only of printable rune
2019-01-14 19:53:25 +03:00
2019-04-06 23:59:01 +03:00
func ChangeFileExt(iFileName, newExt string) string //return file name with new extention
2018-12-15 20:48:08 +03:00
2019-04-06 23:59:01 +03:00
func SeekFileToString(fileName, strToSearch string) (*bufio.Scanner, error) //read text file fileName and return Scanner at line strToSearch
2019-08-14 17:55:02 +03:00
func FindFilesExt(fileList *[]string, path, fileNameExt string) (int, error) //search in path files with extention == fileNameExt and put file name to slice fileList
2018-12-15 20:48:08 +03:00
2019-01-21 02:17:20 +03:00
2019-08-14 17:55:02 +03:00
## tests ##
coverage 96.2%
folder "test_files" contain files for testing, no remove/change/add