Versions in this module Expand all Collapse all v1 v1.24.3 Sep 14, 2025 v1.24.2 Sep 14, 2025 v1.24.1 Sep 14, 2025 v1.24.0 Sep 14, 2025 Changes in this version + const CACHE_DIR_MODE + const CACHE_FILE_MODE + const CACHE_REPLACE + const CACHE_UPDATE + const DEBUG + const DateFormat + const DateFormat2 + const DateFormat3 + const DefaultTagName + const IGNORE_FLOAT + const PathDate + const TextDate + const TimeAndMillisecond + const TimeFormat + const TimeFormat2 + const TimeOnly + const Timestamp + const YearOnly + var ErrDateFormat = errors.New("日期格式无法确定") + var ErrInvalidCopyDestination = errors.New("copy destination is invalid") + var ErrInvalidCopyFrom = errors.New("copy from is invalid") + var ErrInvalidFileStat = errors.New("invalid file stat") + var ErrLengthNotProvided = errors.New("end is nil so length must be provided") + var ErrLengthUndefined = errors.New("limit undefined") + var ErrMapKeyNotMatch = errors.New("map's key type doesn't match") + var ErrNotConvert = errors.New("can not Convert") + var ErrNotSupported = errors.New("not supported") + var ErrRangeInvalid = errors.New("range invalid") + func Bytes2String(b []byte) string + func ChanIsClosed(ch any) bool + func CheckFilepath(filename string, notExistToCreate ...bool) error + func CloseQuietly(closer io.Closer) + func Convert[T any](data []string, v *T) error + func CopyWithOption(toValue any, fromValue any, opt Option) (err error) + func Copy[T any, S any](to *T, from *S) (err error) + func CsvToSlices[S ~[]E, E any](filename string, pointer *S) error + func DateZero(t time.Time) time.Time + func Decimal(value float64, digits ...int) float64 + func DifferDays(t1, t2 time.Time) int + func EndsWith(str string, suffixes []string) bool + func Export(resources embed.FS, source, target string) error + func FileExist(path string) bool + func FileIsValid(path string) bool + func Filter[S ~[]E, E any](slice S, condition func(E) bool) S + func GetConcreteContainerInnerType(in reflect.Type) (inInnerWasPointer bool, inInnerType reflect.Type) + func GetConcreteReflectValueAndType(in any) (reflect.Value, reflect.Type) + func GetMonthDay(date ...string) (string, string) + func GetQuarterByDate(date string, diffQuarters ...int) (quarter, first, last string) + func GetQuarterDay(months ...int) (string, string) + func GetQuarterDayByDate(date string, diffQuarters ...int) (firstOfQuarter, lastOfQuarter string) + func GetWeekDay(date ...string) (string, string) + func GetWeekRange(date ...string) (startStr, endStr string, err error) + func IsEmpty(s string) bool + func IsErrorType(outType reflect.Type) bool + func IsNaN(f float64) bool + func IsWorkday(t time.Time) bool + func KebabCase(s string) string + func Keys[M ~map[K]V, K comparable, V any](m M) []K + func LowerCamelCase(s string) string + func NanosecondToTime(nanoseconds int64) time.Time + func OpenEmbed(resources embed.FS, filename string) (fs.File, error) + func ParseFloat(s string) float64 + func ParseInt(s string) int64 + func ParseTime(timestr string) (time.Time, error) + func ParseUint(s string) uint64 + func Reverse[S ~[]E, E any](s S) S + func SecondToTime(sec int64) time.Time + func SliceSort[S ~[]E, E any](slice S, less func(a, b E) bool) + func SliceUnique[S ~[]E, E any](slice S, compare func(a E, b E) int) S + func SlicesToCsv[S ~[]E, E any](filename string, s S, force ...bool) error + func SnakeCase(s string) string + func StartsWith(str string, prefixes []string) bool + func String2Bytes(s string) []byte + func ToCamelCase(kebab string) (camelCase string) + func ToString(value interface{}) string + func Touch(filename string) error + func Unique[E canUnique](s []E) []E + func UpperCamelCase(s string) string + func UpperKebabCase(s string) string + func UpperSnakeCase(s string) string + func Values[M ~map[K]V, K comparable, V any](m M) []V + type FileStat struct + CreationTime time.Time + LastAccessTime time.Time + LastWriteTime time.Time + func GetFileStat(name string) (*FileStat, error) + type Option struct + DeepCopy bool + IgnoreEmpty bool + type ScopeLimit struct + End *int + Start *int + func IntsToRanges(ints []int) []ScopeLimit + func RangeFinite(start int, end ...int) ScopeLimit + func (r *ScopeLimit) Limited(length int) (start, end int) + func (r *ScopeLimit) Limits(length int) (s int, e int, _ error) + func (r *ScopeLimit) NRows(length ...int) (int, error) + func (r ScopeLimit) String() string