Map are referenced data types — which means it can be null
In #Golang we use map as map[key_type] value_type

package main
import “fmt”

func main() {
// Define the data
data := map[string]string{
“one”: “two”,
“three”: “four”,
“five”: “six”,
“seven”: “eight”,
“nine”: “ten”
}
// loop through
for key, value := range data {
fmt.Println(key, value)
}
}


package main
import (
“fmt”
“math”
)

// Calculate the ² of a given ⁿ values
func calculateEvenNumbersSq(value int) int {
evenSquared := 0
for i := 0; i < value; i++ {
if i%2 == 0 {
evenSquared := math.Pow(float64(i), 2)
fmt.Println(“Square of”, i, “is”, evenSquared)
}
}
return evenSquared
}

func main() {
calculateEvenNumbersSq(1000000000000000000)
}

Iam Gilwell

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store