Generate Random number with math/rand in Go

Tags : random-number

Random number is useful in many application. One such example is salting password to make in more secure. In this tutorial, we will learn how to generate random number in Go with math/rand library.

File : math-rand.go

 package main

 import (

 func main() {

Run the code:

> go run math-rand.go and see how it goes. :-)

  See also : Random number generation with crypto/rand in Go

Tags : random-number

By Adam Ng
