Quantcast
Channel: Variable modification in golang [Mutability] - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by Denys Séguret for Variable modification in golang [Mutability]

Because the map structure doesn't contain the values itself but points to the structures holding the values.As written in the documentation :Like slices, maps hold references to an underlying data...

View Article



Answer by Fred Foo for Variable modification in golang [Mutability]

The function is not modifying the variable, but the value bound to the variable. That's possible because a map is a mutable data structure and passing it to a function does not copy the structure. (A...

View Article

Variable modification in golang [Mutability]

The below code opens up a .txt file and counts the word frequencies. I am following a book and I got confused:My question is here:filename := os.Args[1]frequencyForWord :=...

View Article
Browsing latest articles
Browse All 3 View Live




Latest Images