forked from updogliu/ugo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ugo.go
43 lines (32 loc) · 725 Bytes
/
ugo.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package ugo
import "sort"
func AppendStr(a *[]string, val string) {
*a = append(*a, val)
}
func AppendInt(a *[]int, val int) {
*a = append(*a, val)
}
func AppendI64(a *[]int64, val int64) {
*a = append(*a, val)
}
func AppendUint(a *[]uint, val uint) {
*a = append(*a, val)
}
func AppendU8(a *[]uint8, val uint8) {
*a = append(*a, val)
}
func AppendU64(a *[]uint64, val uint64) {
*a = append(*a, val)
}
func AppendByte(a *[]byte, val byte) {
*a = append(*a, val)
}
func AppendF64(a *[]float64, val float64) {
*a = append(*a, val)
}
func SortI64(a []int64) {
sort.Slice(a, func(i, j int) bool { return a[i] < a[j] })
}
func SortU64(a []uint64) {
sort.Slice(a, func(i, j int) bool { return a[i] < a[j] })
}