-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
91 lines (77 loc) · 1.77 KB
/
main.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
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
// GoLibLearn project main.go
package main
import (
//"GoLibLearn/compressLearn"
//"GoLibLearn/cryptoLearn"
//"GoLibLearn/encodingLearn"
//"GoLibLearn/flagLearn"
//"GoLibLearn/ioLearn"
//"GoLibLearn/pathLearn"
//"GoLibLearn/net"
//"runtime"
//"GoLibLearn/os"
"GoLibLearn/strings"
//"fmt"
)
func main() {
//ioLearn.OpenFile()
//ioLearn.WriteBinary()
//ioLearn.ReadBinary()
//pathLearn.PathLearn()
//runtime.GOMAXPROCS(runtime.NumCPU())
//go net.Server()
//go net.Client()
//select {}
//os.SystemCmd()
//os.Process()
//os.Process_Output()
strings.Str_Method()
//fmt.Println("Hello World!")
//compressLearn.Jiangyou()
//cryptoLearn.Jiangyou()
//encodingLearn.Jiangyou()
//flagLearn.Jiangyou()
//flagLearn.Flag_Method1()
/*compressLearn.ZlibCompress()
flag, err := compressLearn.ZlibUnCompress()
if err != nil {
println(flag)
}
println(flag)
*/
//compressLearn.ZipFile()
//compressLearn.UnZipFile()
//compressLearn.ZipFileAndInfo()
//cryptoLearn.Md5_crypto()
//cryptoLearn.Sha256_crypto()
//cryptoLearn.Sha512_crypto()
//cryptoLearn.HMAC_crypto()
//cryptoLearn.Rand_crypto()
//cryptoLearn.DES_crypto()
//cryptoLearn.RAS_crypto()
//cryptoLearn.Key_crypto()
//cryptoLearn.Check_Crypto()
//encodingLearn.Ecoding_JSON()
//encodingLearn.Ecoding_JSON_Map()
}
/*
recover 和 panic 例子
func readAll(r io.Reader, capacity int64) (b []byte, err error) {
buf := bytes.NewBuffer(make([]byte, 0, capacity))
// If the buffer overflows, we will get bytes.ErrTooLarge.
// Return that as an error. Any other panic remains.
defer func() {
e := recover()
if e == nil {
return
}
if panicErr, ok := e.(error); ok && panicErr == bytes.ErrTooLarge {
err = panicErr
} else {
panic(e)
}
}()
_, err = buf.ReadFrom(r)
return buf.Bytes(), err
}
*/