-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
68 lines (47 loc) · 1.15 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
package main
import (
"fmt"
)
func main() {
// for i := 0; i < 10; i++ {
// fmt.Println("Hello World with new linetest me now \n " +
// " test again")
// if i%3 == 0 {
// fmt.Println("This is mod 3 : " + strconv.FormatInt(int64(i), 10))
// quote.Hello()
// }
// }
const foo = "bar"
fmt.Println(foo)
checkResult := 99
fmt.Println(checkResult)
checkResult += 55
fmt.Println(checkResult)
strCheckResult := "foo" // := short decoration operator
fmt.Println(strCheckResult)
//strCheckResult += " : " + strconv.FormatInt(int64(checkResult), 10)
fmt.Println("==========================================")
strCheckResult += fmt.Sprintf(" : %d", checkResult)
fmt.Println(strCheckResult)
var z int = 99
fmt.Println(z)
var a bool = true
fmt.Println(a)
fmt.Println("==========================================")
justFloat := fmt.Sprintf("%.5f", 99.93333)
fmt.Println(justFloat)
personObj := new(person)
n := "HH"
personObj.name = &n
//person.age = 50
passMe(&personObj.name)
fmt.Println(personObj.name)
}
type person struct {
name *string
age *int
}
func passMe(str **string) {
**str = "My NewStr"
fmt.Println(*str)
}