Go API code format and Connection close

1. Code format with  go fmt.
2. Go API add connection close