title: How to print the result one by one from an array in golang?
body: <p>In this code, I am finding the data based on email and password. But I want to do another thing that is to use a <code>for loop</code> and print the <code>result</code> array data one by one.</p>
  <p><strong>Given result</strong></p>
  <pre><code>Found a single document: {Name:bilal Email:bilal@gmail.com Password:bilalo Business:computer company}
  </code></pre>
  <p><strong>Expected result</strong></p>
  <pre><code>Name:bilal 
  Email:bilal@gmail.com 
  Password:1234 
  Business:computer company
  </code></pre>
  <p><strong>Code</strong></p>
  <pre><code>// Find data in database based on email and password
  var result Store
  collection := client.Database(&quot;PMS&quot;).Collection(&quot;dataStored&quot;)
  if err = collection.FindOne(context.TODO(), bson.M{&quot;email&quot;: myEmail, &quot;password&quot;: myPassword}).Decode(&amp;result); err != nil {
      log.Fatal(err)
  }
  fmt.Printf(&quot;Found a single document: %+v\n&quot;, result)
  
  for _, results := range &amp;result {
      fmt.Println(results)
  }
  </code></pre>