title: How to list running instances on Google Cloud Platform with Go
body: <p>I'm trying to learn Go by managing Google Cloud Platform. I didn't understand how to use related functions about Compute. The goal is listing instances with some go code.</p>
  
  <p>This is <a href="https://godoc.org/google.golang.org/api/compute/v1#InstancesService.List" rel="nofollow noreferrer">https://godoc.org/google.golang.org/api/compute/v1#InstancesService.List</a> the related function.</p>
  
  <pre><code>func (r *InstancesService) List(project string, zone string) *InstancesListCall
  </code></pre>
  
  <p>There are two structs, InstancesService and InstancesListCall</p>
  
  <p>As far as i understand i should define these structs but it's not clear the things should be defined in the structs. I've searched for examples but many of them using rest calls instead of golang api. Have any idea how to list instances with go?</p>