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
| package main
import ( "fmt" )
var gA int = 100 var gB = 200
func main() { var a int fmt.Println("a = ", a) fmt.Printf("type of a = %T\n", a)
var b int = 100 fmt.Println("b = ", b) fmt.Printf("type of b = %T\n", b)
var bb string = "abcd" fmt.Printf("bb = %s, type of bb = %T\n", bb, bb)
var c = 100 fmt.Println("c = ", c) fmt.Printf("type of c = %T\n", c)
var cc = "abcd" fmt.Printf("cc = %s, type of cc = %T\n", cc, cc)
e := 100 fmt.Println("e = ", e) fmt.Printf("type of e = %T\n", e)
f := "abcd" fmt.Println("f = ", f) fmt.Printf("type of f = %T\n", f)
g := 3.14 fmt.Println("g = ", g) fmt.Printf("type of g = %T\n", g)
fmt.Println("gA = ", gA, ", gB = ", gB)
var xx, yy int = 100, 200 fmt.Println("xx = ", xx, ", yy = ", yy) var kk, ll = 100, "Aceld" fmt.Println("kk = ", kk, ", ll = ", ll)
var ( vv int = 100 jj bool = true ) fmt.Println("vv = ", vv, ", jj = ", jj) }
|