-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstring.go
More file actions
101 lines (78 loc) · 3.19 KB
/
Copy pathstring.go
File metadata and controls
101 lines (78 loc) · 3.19 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
package iterium
// concatMultipleSlices merge more than two slices at once.
func concatMultipleSlices[T any](slices ...[]T) (result []T) {
for _, s := range slices {
result = append(result, s...)
}
return result
}
// AsciiLowercase represents lower case letters.
var AsciiLowercase = []string{
"a", "b", "c", "d", "e", "f", "g",
"h", "i", "j", "k", "l", "m", "n",
"o", "p", "q", "r", "s", "t", "u",
"v", "w", "x", "y", "z",
}
// AsciiUppercase represents upper case letters.
var AsciiUppercase = []string{
"A", "B", "C", "D", "E", "F", "G",
"H", "I", "J", "K", "L", "M", "N",
"O", "P", "Q", "R", "S", "T", "U",
"V", "W", "X", "Y", "Z",
}
// AsciiLetters is a concatenation of AsciiLowercase and AsciiUppercase.
var AsciiLetters = concatMultipleSlices(AsciiLowercase, AsciiUppercase)
// AsciiLowercaseBytes represents lower case letters as bytes.
var AsciiLowercaseBytes = []byte("abcdefghijklmnopqrstuvwxyz")
// AsciiUppercaseBytes represents upper case letters as bytes.
var AsciiUppercaseBytes = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
// AsciiLettersBytes is a concatenation of AsciiLowercaseBytes and AsciiUppercaseBytes.
var AsciiLettersBytes = concatMultipleSlices(AsciiLowercaseBytes, AsciiUppercaseBytes)
// Digits is a slice of the digits in the string type.
var Digits = []string{
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
}
// DigitsBytes is a slice of ASCII digit bytes.
var DigitsBytes = []byte("0123456789")
// HexDigits represents hexadecimal letters.
var HexDigits = []string{
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
"a", "b", "c", "d", "e", "f", "A", "B", "C", "D",
"E", "F",
}
// HexDigitsBytes represents hexadecimal bytes.
var HexDigitsBytes = []byte("0123456789abcdefABCDEF")
// OctDigits represents octadecimal letters.
var OctDigits = []string{
"0", "1", "2", "3", "4", "5", "6", "7",
}
// OctDigitsBytes represents octal digit bytes.
var OctDigitsBytes = []byte("01234567")
// AsciiLowercaseRunes represents lower case letters as runes.
var AsciiLowercaseRunes = []rune("abcdefghijklmnopqrstuvwxyz")
// AsciiUppercaseRunes represents upper case letters as runes.
var AsciiUppercaseRunes = []rune("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
// AsciiLettersRunes is a concatenation of AsciiLowercaseRunes and AsciiUppercaseRunes.
var AsciiLettersRunes = concatMultipleSlices(AsciiLowercaseRunes, AsciiUppercaseRunes)
// DigitsRunes is a slice of ASCII digit runes.
var DigitsRunes = []rune("0123456789")
// HexDigitsRunes represents hexadecimal runes.
var HexDigitsRunes = []rune("0123456789abcdefABCDEF")
// OctDigitsRunes represents octal digit runes.
var OctDigitsRunes = []rune("01234567")
// Punctuation is a slice of ASCII characters that
// are considered punctuation marks in the C locale
var Punctuation = []string{
"!", "\"", "#", "$", "%", "&", "'", "(",
")", "*", "+", ",", "-", ".", "/", ":",
";", "<", "=", ">", "?", "@", "[", "\\",
"]", "^", "_", "`", "{", "|", "}", "~",
}
// Whitespace contains all ASCII characters that are considered whitespace
var Whitespace = []string{
" ", "\t", "\n", "\r", "\x0b", "\x0c",
}
// Printable is a slice of ASCII characters which are considered printable.
var Printable = concatMultipleSlices(
Digits, AsciiLetters, Punctuation, Whitespace,
)