Go Map Create

Description

Go Map Create

package main/*from  w  ww. ja v  a  2s. c  o m*/

import (
"fmt"
)

func main() {
  var country map[int]string
  country = make(map[int] string)
  country[1]="Java"
  country[2]="SQL"
  country[3]="CSS"
  country[4]="Javascript"
  country[5]="CSS HTML"
  country[6]="C++"
  for i, j := range country {
    fmt.Printf("Key: %d Value: %s\n", i, j)
  }
}



PreviousNext

Related