- Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathmain.go
34 lines (25 loc) · 726 Bytes
/
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
// 1.
package main
import"fmt"
funcmain() {
// Name doesn't change (usually) that's why we set it as a constant
constname="Leo"
varage="25"
fmt.Println("Hello, my name is", name, "and I'm", age, "years old")
}
/* 2. The following program will fail simply because the
'objective' variable is not used. In Go, you must use
every defined variable
package main
import "fmt"
func main() {
fmt.Println("Skynet Beta Testing")
var objective="Protect Humanity"
}
Some will say it fails because Skynet wasn't designed
to protect humanity...it's quite good argument.
*/
/* 3. The following program will fail because squares is
a constant. That means you shouldn't change its value
once declared.
*/