Documentation ¶
Index ¶
- Variables
- func ArrangeById[T any](id []int, val []T, getId func(*T) int) []T
- func AtoiDefault(str string, def int) int
- func CopyFile(src, dst string) (int64, error)
- func DeepCopy(dst, src any) error
- func DeleteSlice[T any](a []T, id int)
- func FileExists(filename string) bool
- func FindIndex[T comparable](array []T, v T) int
- func GetTempDir() (string, error)
- func HasElement[T comparable](arr []T, val T) bool
- func HasInt(srt []int, val int) bool
- func If[T any](a bool, b T, c T) T
- func JoinArray[T any](val []T) string
- func Map[T any, M any](s []T, f func(T) M) []M
- func Max[T Numbers](a, b T) T
- func Min[T Numbers](a, b T) T
- func RandomString(n int) string
- func ResortEntry[T any](a []T, f func(int, int) bool, id int)
- func Reverse[T any](arr []T)
- func SHA256(str string) string
- func StartsWith(a, b string) bool
- func TimeStamp() int64
- func TopoSort(size int, dependon func(i, j int) bool) (res []int, err error)
- func UnzipMemory(mem []byte) (map[string][]byte, error)
- type ByteValue
- type Checksum
- type CtntType
- type HashValue
- type LangTag
- type Numbers
Constants ¶
This section is empty.
Variables ¶
View Source
var LangSuf = []string{
".cpp98.cpp",
".cpp11.cpp",
".cpp14.cpp",
".cpp17.cpp",
".cpp20.cpp",
".py2.py",
".py3.py",
".go",
".java",
".c",
".txt",
".py",
}
Functions ¶
func ArrangeById ¶
every entry of val has an id, we will arrange val such that the result matches the given id array
func AtoiDefault ¶
func DeleteSlice ¶
func FileExists ¶
func FindIndex ¶
func FindIndex[T comparable](array []T, v T) int
index of the first element equaling to v, otherwise return -1
func GetTempDir ¶
func HasElement ¶
func HasElement[T comparable](arr []T, val T) bool
func RandomString ¶
func ResortEntry ¶
resort an sorted array after one entry has modified
Types ¶
type Checksum ¶
type Checksum [32]byte
comparable
func FileChecksum ¶
SHA256 hash for file content. for any error, return empty hash
func ReaderChecksum ¶
Click to show internal directories.
Click to hide internal directories.