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 71 72 73 74 75 76 77 78 79 80 81 82 83 84
| package main
import "fmt" import . "fmt"
import ( "fmt" "math" )
const PI = 3.14
const ( Unknown = 0 Female = 1 Male = 2 ) const ( a = iota b = iota c = iota )
var name = "go"
var flag bool var flag = false flag := false
type newType int
type user struct{}
type golang interface{}
func getId() int {} func Printf() {}
func numbers()(int,int,string){ a , b , c := 1 , 2 , "str" return a,b,c }
for i := 0; i < 100; i++ { } for true { }
var balance = [5]float32{1000.0, 2.0, 3.4, 7.0, 50.0} balance :=[...]float32{1.0,2.0,3.0} len(balance) numbers := make([]int,0,5)
balance = append(balance, 5, 6, 6, 7)
s := []int{2, 3, 5, 7, 11, 13} s = s[:0] s = s[:2]
for i, num := range nums { if num == 3 { fmt.Println("index:", i) } }
var map_variable map[key_data_type]value_data_type
map_variable := make(map[key_data_type]value_data_type)
|