title: Struct returned by function isn't changed in array it belongs to
body: <p>I am writing a small GUI-application in <code>Gotk3</code>, this is my basic setup in pseudo-code:</p>
  
  <pre><code>type Point struct {
      X float64
      Y float64
      IsSelected bool
  }
  
  func getClosestElement(pT []Point, p Point, maxDist float64) Point {
      /* returns the point from pT with the minimum distance to p */
  }
  
  func main() {
      // GTK init ..
      selectedPoints := make([]Point, 0)
  
      /* GTK-Event onMouseClick */
      {
          /* if left mouse click */
          selectedPoints = append(selectedPoints, Point{X: event.x, Y: event.y})
          /* if right mouse click */
          closestPoint = getClosestElement(selectedPoints, Point{X: event.x, Y: event.y}, 15.0)
          closestPoint.IsSelected = true
      }
  
      /* GTK-Event Draw */
      {
          /* Loop over all selectedPoints */
          if selectedPoint.IsSelected
          /* Draw point in blue and also print to console, if a selected point was detected */
          else
          /* Draw point in black */
      }
  }
  </code></pre>
  
  <p>But somehow, even though getting the closest Point from <code>selectedPoints</code> works fine, I never get the console output for looping over a point which <code>IsSelected</code>property is true nor do I get a blue drawn point (which would indicate that this point is selected).</p>
  
  <p>This leaves me with the question if a returned struct, which was part of a slice which was initialy given to the function, is actually returned by value instead of by reference. So a change to this returned point doesn't change the point in the array it former belonged to?</p>