challenge.go
go-csharp-python-traps.md
Go
Business logic
Difficulty 3/3
1
package
profiles
2
3
var
cache =
map
[
string
]Profile{}
4
5
func
Get(id
string
) Profile {
6
if
p, ok := cache[id]; ok {
7
return
p
8
}
9
p := load(id)
10
cache[id] = p
11
return
p
12
}