> For the complete documentation index, see [llms.txt](https://gitbook.joeir.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.joeir.net/docker-compose-cheatsheet/golang/gotchas.md).

# Gotchas

## Memory addresses in loops

What is the output of the `targetValue` pointer's value?

```go
package main

import "fmt"

var tags = map[string]string{
  "one":   "one",
  "two":   "two",
  "three": "three",
}

func main() {
  targetKey := "two"
  var targetValue *string
  for key, value := range tags {
    if key == targetKey {
      targetValue = &value
    }
  }
  fmt.Println(*targetValue)
}
```
