-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmaps.go
More file actions
43 lines (36 loc) · 717 Bytes
/
maps.go
File metadata and controls
43 lines (36 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main
import "fmt"
func main() {
/*
idiomas := make(map[string]string)
idiomas["es"] = "Español"
idiomas["en"] = "Inglés"
idiomas["fr"] = "Francés"
*/
/*
idiomas := map[string]string{
"es": "Español",
"en": "Inglés",
"fr": "Francés",
"pt": "Portugués",
}
*/
/*
fmt.Println(idiomas)
delete(idiomas, "en")
fmt.Println(idiomas)
*/
/*
if idioma, ok := idiomas["pt"]; ok {
fmt.Println("La posición pt sí existe y vale", idioma)
} else {
fmt.Println("La posición pt NO existe")
}
*/
numeros := map[uint16]string{
1: "Uno es un número chiquito",
2016: "Esto es otro número",
4: "Aquí la llave es negativa",
}
fmt.Println(numeros)
}