Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "log"
- )
- func main() {
- m := map[int]string{
- 1: "one",
- 2: "two",
- 3: "three",
- }
- v, ok := m[1]
- if !ok {
- log.Fatal("Unable to retrieve key/value pair")
- }
- if !(v == "one") {
- log.Fatal("Wrong value")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement