Related questions
Extracting substrings in Go
I'm trying to read an entire line from the console (including whitespace), then process it. Using bufio.ReadString, the newline character is read together with the input, so I came up with the following code to trim the newline character:
…
How to check if a map contains a key in Go?
I know I can iterate over a map m by,
for k, v := range m { ... }
and look for a key but is there a more efficient way of testing a key's existence in a map?
I couldn't find the answer …