Golang vs Python - hqzhang/cloudtestbed GitHub Wiki

It seems Golang come from Python, So I will do comparison as followings:

1. import part
Go has package name while Py uses file name directly.
So Go import other package name while py import other file name as module.
Go use real directory for package while python use Java style package path.

2. function
go use func while py use def
go declare variable as reverse order vs c
go declare by := and var
go function return in back vs C:
     func foo(par type,)( type1,type2)
go use type T struct as class while py just use class
go declare variable as reverse order vs c
go for/if/ without round bracket vs c while 
go defer execute before return

3. pointer as C
go array var a [10]int
go slice var s []int //array without border
go create slice a := make([]int, 5)
go append slice append(a,5)
go for i, v := range slice
go map: var m map[string]Vertex   while py use dict{}
go create:m = make(map[string]Vertex)