title: How to retrieve array of elements from array of structure in golang?
body: <p>I am new to golang, and got stuck at this. I have an array of structure:</p>
  
  <pre><code>Users []struct {
     UserName string 
     Category string
     Age string
  }
  </code></pre>
  
  <p>I want to retrieve all the UserName from this array of structure. So, output would be of type:</p>
  
  <pre><code>UserList []string 
  </code></pre>
  
  <p>I know the brute force method of using a loop to retrieve the elements manually and constructing an array from that. Is there any other way to do this?</p>