package main import ( "fmt" "sync" ) var l sync.Mutex var a string func f() { a = "hello, world" l.Unlock() } //还是需要加锁的!!! type testClass struct { mutex sync.Mutex x []byte } func (this *testClass) init() { this.x = make([]by…
package main import ( "fmt" "reflect" ) type order struct { ordId int customerId int } func createQuery(q interface{}) { t := reflect.TypeOf(q) //----NB啊 if t.String() == "main.order" { fmt.Println("Type ", t) fmt.P…