-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathla.go
117 lines (96 loc) · 2.16 KB
/
la.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
package main
import (
"github.com/op/go-logging"
"go/logger"
_ "go/logger"
"math"
)
func main() {
log := logger.MyLogger
//log.Debugf("debug %s ______________________________________________________", logger.Password("secret") )
//log.Info("info _______________________________________________________________")
//log.Notice("notice _____________________________________________________________")
//log.Warning("warning ____________________________________________________________")
//log.Error("err ________________________________________________________________")
//log.Critical("crit _______________________________________________________________")
var u uint8 = 255
log.Debug(u, u+1, u, u*u)
var i int8 = 127
log.Debug(i, i+1, i, i*i)
var x, y = 2, 2
log.Debug(x < y)
log.Debug(false != true)
var q, w, e, r = false, false, true, true
log.Debug(q, w, e, r)
//bitwiseOperation(log)
log.Debug(math.MaxInt8)
}
func bitwiseOperation(log *logging.Logger) {
log.Debug(2 * 2)
log.Debug("__&_")
log.Debug(2 & 10)
log.Debug(4 & 2)
log.Debug(2 & 4)
log.Debug("__|_")
log.Debug(2 | 2)
log.Debug(4 | 2)
log.Debug(2 | 4)
log.Debug("__^_")
log.Debug(2 ^ 2)
log.Debug(4 ^ 2)
log.Debug(2 ^ 4)
log.Debug("__&^_")
log.Debug(2 &^ 2)
log.Debug(4 &^ 2)
log.Debug(2 &^ 4)
log.Debug("__<<_")
log.Debug(2 << 2)
log.Debug(4 << 2)
log.Debug(2 << 4)
log.Debug("__>>_")
log.Debug(2 >> 2)
log.Debug(4 >> 2)
log.Debug(2 >> 4)
}
/*
func main() {
//fmt.Println(rand.NewSource(time.Now().UnixNano()))
//a,s := 1, 2
//fmt.Println(incr(&a))
//fmt.Println(incr2(&s))
//incr2(&s)
//fmt.Println(a,s)
//t := Properties{}
//s := reflect.ValueOf(&t).Elem()
//typeOfT := s.Type()
//for i := 0; i < s.NumField(); i++ {
// f := s.Field(i)
// fmt.Printf("%d: %s %s = %v\n", i, typeOfT.Field(i).Name, f.Type(), f.Interface())
//}
s := "5"
var i int
//i = strconv.ParseInt(s, int, 16)
i, err := strconv.Atoi(s)
if err != nil {
panic(err)
}
fmt.Println(i)
}
func incr(i *int) int {
*i++
return *i
}
func incr2(i *int) {
*i++
}
type T struct {
A int
B string
}
type Properties struct {
Cycles int
Res float64
Size int
Nframes int
Delay int
}*/