File tree 4 files changed +50
-0
lines changed
4 files changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ go 1.22.0
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import "fmt"
4
+
5
+ func main () {
6
+
7
+ fmt .Println ("Hello, Ninjas!" )
8
+
9
+ }
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import "fmt"
4
+
5
+ func main () {
6
+
7
+ //strings
8
+ var nameOne string = "Hello World!" //string literal is a sequence of characters enclosed in double quotes
9
+
10
+ var nameTwo = "nice"
11
+
12
+ var nameThree string
13
+ nameThree = "to meet you."
14
+
15
+ nameFour := "I am learning Go." //:= is used to declare and initialize a variable in the same statement. It's called a short declaration.
16
+
17
+ fmt .Println (nameOne )
18
+ fmt .Println ("I am Alice" , nameTwo ) //%v prints the value
19
+ fmt .Println (nameThree , nameFour )
20
+
21
+ //ints
22
+ var ageOne int = 20
23
+ var ageTwo = 20
24
+ ageThree := 20
25
+ fmt .Println (ageOne , ageTwo , ageThree )
26
+
27
+ // bits & memory
28
+ var numOne int8 = 25
29
+ var numTwo int8 = - 128
30
+ var numThree uint16 = 256
31
+
32
+ fmt .Println (numOne , numTwo , numThree )
33
+
34
+ var scoreOne float32 = 25.69
35
+ var scoreTwo float64 = - 5243254355644531513545.351638464
36
+ scoreThree := 1.5
37
+
38
+ fmt .Println (scoreOne ,scoreTwo ,scoreThree )
39
+
40
+ }
You can’t perform that action at this time.
0 commit comments