In Visual Studio Code, the auto-complete tool (which I presume is gopls
?) gives the following template:
m.Range(func(key, value any) bool {
})
where m
is a sync.Map
. the type any
is not recognized, but is put there.
What is any
? Can I put the type I want and hope Go 1.18 to do implicit type conversion for me? For example:
m.Range(func(k, v string) { ... })
which will give k
, v
as string inside the callback, without having to do type cast myself?