Go中是否有一个函数可以打印对象的所有当前成员名称和值?

I'm looking for something like PHP's print_r or python's dict. Anybody know if this function exists, or its something that needs to be implemented?

There is a reflect package in go.
You can find solution to your problem in the following article.

For printing native go objects, like maps, slices, and arrays, you can try:

fmt.Printf("%v", object)

However there isn't a general method to do it with user-defined struct types..

Try

fmt.Printf("%+v", object)

That might give you something resembling what you want.

You can try using the package dump, which acts similar to PHP's print_r or var_dump.

The sources are here and the main project page is here.

Then just call dump.Dump(yourObject) or dump.Fdump(file, yourObject)