ylx

package module
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2020 License: GPL-3.0 Imports: 0 Imported by: 0

README

YLX的go函数库

== ylx's golang utils ==

- 一般函数
// search a string key from a slice
// 如果返回值为负数,表明该slice中不存在该该值
// 从两端往slice中间进行搜索,加快搜索速度
func SliceSearchString(s []string, key string) (rs int)
- 路径处理
// check dir is exist
// 检查目录是否存在
// 如果路径存在 exist = true
// 如果路径存在且该路径为一个目录 exist = true, isDir = true
func DirIsExist(path string) (exist bool, isDir bool)
// check or create dir
// 如果返回值为nil,路径存在且正确
// 如果路径不存在,该函数会自动创建路径 mode = 0644
func CheckOrCreateDir(path string) error
- 字符串处理
// Capitalize: change first character to upper
// 首字母字符串大写
func Capitalize(str string) string 
- 时间处理
// return start timestamp in this day
// 返回本天第一个时间节点的时间戳
func ThisDay(t time.Time) (start int64)
// return start timestamp in this month
// 返回本月第一个时间节点的时间戳
func ThisMonth(t time.Time) (start int64) 
// return start timestamp in this quarte
// 返回本季度第一个时间节点的时间戳
func ThisQuarte(t time.Time) (start int64) 
// return start timestamp in this year
// 返回本年第一个时间节点的时间戳
func ThisYear(t time.Time) (start int64)

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cera

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL