forked from JawherKl/go-language-study
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
52 lines (40 loc) · 913 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package main
import "fmt"
// Hello App
func main() {
fmt.Println("Hello, App!")
// Variables and Data types
// Variables
var foo string
var foo string = "Go is awesome!"
var foo, bar string = "Go", "is awesome!"
var (
foo string = "Go"
bar string = "is awesome!"
)
var foo = "What's my type?"
// Constants
const constant = "This is a constant"
// Data Types
// String
var name string = "My name is Go"
var bio string = `I am statically typed.
I was designed at Google.`
// Bool
var value bool = false
var isItTrue bool = true
// Numeric types
type byte = uint8
type rune = int32
var b byte = 'a'
var r rune = '🍕'
var f32 float32 = 1.7812 // IEEE-754 32-bit
var f64 float64 = 3.1415 // IEEE-754 64-bit
var c1 complex128 = complex(10, 1)
var c2 complex64 = 12 + 4i
var i int
var f float64
var b bool
var s string
fmt.Printf("%v %v %v %q\n", i, f, b, s)
}