Skip to content

Instantly share code, notes, and snippets.

@jjuliano
Last active December 16, 2019 11:05
Show Gist options
  • Save jjuliano/2a344c7bc258c1fa769f626b585cecb8 to your computer and use it in GitHub Desktop.
Save jjuliano/2a344c7bc258c1fa769f626b585cecb8 to your computer and use it in GitHub Desktop.
package main
import(
"fmt"
"github.com/google/uuid"
)
func main() {
variable := map[interface{}]string{}
variable[1] = "from an integer key"
variable["a"] = "from string key"
uuid := uuid.New()
variable[uuid] = "from a UUID key"
fmt.Println(variable[1]) // from an integer key
fmt.Println(variable["a"]) // from string key
fmt.Println(variable[uuid]) // from a UUID key
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment