To create a map with a key of type rune
in Go, we can use the built-in make()
function with the map[rune]
syntax. Here's an example:
main.go237 chars11 lines
In this example, we created a map m
with keys of type rune
and values of type string
. We added some key-value pairs to the map, and then used the key 'b'
to retrieve the value "banana"
.
gistlibby LogSnag