Go Package rand

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Overview

The package math/rand.

rand.New()

Generating a new random integer:

import (
  "math/rand"
  "time"
)

i := rand.New(rand.NewSource(time.Now().UnixNano())).Int()

rand.NewSource()