title: Can't indexing an array without using another var
body: <p>I think is something that I miss theoretically from the passing by reference topic but I can't find a way to read the <code>ID</code> without using the support <code>networkInterfaceReference</code></p>
  <pre class="lang-golang prettyprint-override"><code>package main
  
  import (
      &quot;context&quot;
      &quot;fmt&quot;
  
      &quot;github.com/Azure/azure-sdk-for-go/profiles/preview/resources/mgmt/resources&quot;
      &quot;github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-03-01/compute&quot;
      &quot;github.com/Azure/azure-sdk-for-go/services/subscription/mgmt/2020-09-01/subscription&quot;
      &quot;github.com/Azure/go-autorest/autorest/azure/auth&quot;
      &quot;github.com/ktr0731/go-fuzzyfinder&quot;
  )
  
  var selectedSub subscription.Model
  var selectedRG resources.Group
  var selectedVM compute.VirtualMachine
  
  func main() {
      selectedSub = GetSubscription()
      selectedRG = GetResourceGroup()
      selectedVM = GetVM()
  
      fmt.Printf(&quot;Sub: %s\nRG: %s\nVM: %s\n&quot;, *selectedSub.DisplayName, *selectedRG.Name, *selectedVM.Name)
  
      // THIS WORK
      networkInterfaceReference := *selectedVM.NetworkProfile.NetworkInterfaces
      fmt.Printf(&quot;%s&quot;, *networkInterfaceReference[0].ID)
  
      // THIS DOESN'T WORK
      fmt.Printf(&quot;%s&quot;, *selectedVM.NetworkProfile.NetworkInterfaces[0].ID)
  }
  
  ...
  ...
  ...
  
  func GetVM() compute.VirtualMachine {
      vmClient := compute.NewVirtualMachinesClient(*selectedSub.SubscriptionID)
      authorizer, err := auth.NewAuthorizerFromCLI()
      if err == nil {
          vmClient.Authorizer = authorizer
      }
      vmList, err := vmClient.List(context.TODO(), *selectedRG.Name)
      if err != nil {
          panic(err)
      }
  
      idx, err := fuzzyfinder.Find(vmList.Values(), func(i int) string {
          return *vmList.Values()[i].Name
      })
      if err != nil {
          panic(err)
      }
  
      return vmList.Values()[idx]
  }
  </code></pre>
  <p>Hovering to the error showed the following error message:</p>
  <pre><code>field NetworkProfile *[]compute.NetworkProfile
  (compute.VirtualMachineProperties).NetworkProfile on pkg.go.dev
  
  NetworkProfile - Specifies the network interfaces of the virtual machine.
  
  invalid operation: cannot index selectedVM.NetworkProfile.NetworkInterfaces (variable of type *[]compute.NetworkInterfaceReference)compiler (NonIndexableOperand)
  </code></pre>