

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
click for more info
Not enough gems
Cost: 6 gems
1: Maps
incomplete
2: Mutations
incomplete
3: Key Types
incomplete
4: Count Instances
incomplete
5: Effective Go
incomplete
6: Nested
incomplete
7: Distinct Words
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
m[key] = elem
elem = m[key]
delete(m, key)
elem, ok := m[key]
key is in m, then ok is true and elem is the value as expected.key is not in the map, then ok is false and elem is the zero value for the map's element type.It's important to keep up with privacy regulations and to respect our user's data. We need a function that will delete user records.
Complete the deleteIfNecessary function. The user struct has a scheduledForDeletion field that determines if they are scheduled for deletion or not.
Like slices, maps are reference types. When a map is passed into a function, we can make changes to the original – we don't have a copy.