How to update a struct property in a map : <p>Currently trying to learn Go.</p>

<p>I have the following function, but it only works when the team doesn't exist in the map already and it creates a new record in the map.  It will not update the values if the team already has a struct in the map.</p>

<pre><code>func AddLoss(teamMap map[string]TeamRow, teamName string) {
    if val, ok := teamMap[teamName]; ok {
        val.Wins++
        val.GamesPlayed++
    } else {
        newTeamRow := TeamRow{Losses: 1}

        teamMap[teamName] = newTeamRow
    }
}
</code></pre>

<p>I have updated the function to just replace the existing record with a brand new struct with the values I want, but that seems odd that I can't update the values in a map.</p>

<p>Can someone explain this to me, or point me in the right direction?</p>
