Documentation
¶
Index ¶
- Constants
- func CamelToSnakeCase(input string) string
- func CopyMap[K comparable, V any](m map[K]V) map[K]V
- func CreateDir(dir string) error
- func FileExists(filepath string) bool
- func FirstLetterToLower(s string) string
- func FirstLetterToUpper(s string) string
- func GetDate(offset int) string
- func GetFileExtension(name string) string
- func GetLastDay() string
- func GetLastMonthRange() (string, string)
- func GetLastWeekRange() (string, string)
- func GetLastYearRange() (string, string)
- func GetMonth(offset int) string
- func GetMonthRange(offset int) (string, string)
- func GetThisMonthRange() (string, string)
- func GetThisWeekRange() (string, string)
- func GetThisYearRange() (string, string)
- func GetToday() string
- func GetWeekRange(offset int) (string, string)
- func GetYear(offset int) string
- func GetYearRange(offset int) (string, string)
- func LinkedListToArray(l *list.List, dest any) error
- func PathExists(path string) (bool, error)
- func ReplaceIdToID(str string) string
- func SliceContain[T comparable](slice []T, element T) bool
- func SliceDiff[T comparable](a, b []T) []T
- func SliceDuplicate[T comparable](s []T) []T
- func SnakeToLowerCamel(s string) string
- func SnakeToPascal(s string) string
- func TimeFormat(t time.Time, format string) string
- func ToJsonString(v any) string
- func ToString(v any) string
- func Trim(str string) string
- func TrimFileExtension(name string) string
- func VToFloat64(v any) float64
- func VToInt64(v any) int64
- func VToUint64(v any) uint64
- type TreeNode
- type TreeNodeData
Constants ¶
View Source
const ( YYYY_MM_DD_HH_MM_SS = "2006-01-02 15:04:05" YYYY_MM_DD = "2006-01-02" MM_DD = "01-02" YYYY = "2006" YYYYMMDD = "20060102" YYYYMM = "200601" MMDD = "0102" DayDuration = 24 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
func CopyMap ¶
func CopyMap[K comparable, V any](m map[K]V) map[K]V
func FirstLetterToLower ¶
func GetLastDay ¶
func GetLastDay() string
func GetLastMonthRange ¶
func GetLastWeekRange ¶
GetLastWeekRange 获取上周的起始和结束日期,如 20230824, 20230830
func GetLastYearRange ¶
func GetMonthRange ¶
GetMonthRange 获取指定偏移月的起始日期和结束日期,如 20230901, 20230930 offset: 相对于当前月的偏移量,0 表示当前月,-1 表示上个月,1 表示下个月
func GetThisMonthRange ¶
func GetThisWeekRange ¶
GetThisWeekRange 获取本周的起始和结束日期,如 20230901, 20230907
func GetThisYearRange ¶
func GetWeekRange ¶
GetWeekRange 获取本周的起始和结束日期,返回示例:20230901, 20230907 offset: 0 表示本周,-7 表示上周
func GetYearRange ¶
func PathExists ¶
func SliceContain ¶
func SliceContain[T comparable](slice []T, element T) bool
func SliceDuplicate ¶
func SliceDuplicate[T comparable](s []T) []T
func ToJsonString ¶
func VToFloat64 ¶
Types ¶
type TreeNode ¶
type TreeNode struct { ID int // 节点的唯一标识符 ParentID int // 节点的父节点的唯一标识符 TreeNodeData Children []*TreeNode // 节点的子节点 }
TreeNode 结构体表示树的一个节点
type TreeNodeData ¶
type TreeNodeData any
Click to show internal directories.
Click to hide internal directories.