Documentation
¶
Index ¶
- func CompareAny(a, b any) int
- func ConvertDateFormat(pattern string) string
- func ConvertToDateString(value any, goDateFormat string) string
- func FormatValue(value any) string
- func GetTerminalWidth() int
- func GetTypeSortingRank(v any) int
- func IsColorSupported() bool
- func ParallelMergeStable[S ~[]E, E any](x S, cmp func(E, E) int, numChunks int)
- func ParallelSortStableFunc[S ~[]E, E any](x S, cmp func(E, E) int)
- func ParseColIndex(colIndex string) int
- func ToFloat64(v any) float64
- func ToFloat64Safe(v any) (float64, bool)
- func TruncateString(s string, maxLength int) string
- type F64orRat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareAny ¶ added in v0.2.5
CompareAny compares two values of any type and returns: -1 if a < b
0 if a == b 1 if a > b
It uses type ranking and type-specific comparison logic.
func ConvertDateFormat ¶ added in v0.2.4
ConvertDateFormat 將常見的日期格式模式轉換為 Go 語言的時間格式
func ConvertToDateString ¶ added in v0.2.6
convertToDateString 將日期值或時間戳轉換為指定格式的字串(使用Go時間格式)
func FormatValue ¶ added in v0.2.5
FormatValue 根據值的類型格式化輸出,改善顯示效果
func GetTypeSortingRank ¶ added in v0.2.5
GetTypeSortingRank returns the type rank for sorting mixed types. Lower rank means higher priority (comes first in ascending order).
func IsColorSupported ¶ added in v0.2.9
func IsColorSupported() bool
IsColorSupported 檢測當前終端是否支持 ANSI 顏色代碼
func ParallelMergeStable ¶ added in v0.2.6
ParallelMergeStable merges the sorted chunks in the slice x. It assumes x is divided into numChunks sorted sub-slices.
func ParallelSortStableFunc ¶ added in v0.2.6
ParallelSortStableFunc sorts the slice x in ascending order as determined by the cmp function. It is a parallelized version of slices.SortStableFunc, using goroutines to improve performance on large datasets. The function maintains stability: equal elements preserve their original order. This optimized version uses adaptive goroutines scaling and improved chunking strategy.
func ParseColIndex ¶
func ToFloat64Safe ¶ added in v0.2.5
ToFloat64Safe tries to convert any numeric value to float64 and returns a boolean indicating success.
func TruncateString ¶ added in v0.2.5
TruncateString 截斷字符串到指定寬度,太長的字符串末尾加上省略號,使用 runewidth 計算字元寬度