The go language returns methods for random Numbers between 1 and 99

  • 2020-05-26 09:19:24
  • OfStack

This example demonstrates how the go language returns random Numbers between 1 and 99. Share with you for your reference. The specific implementation method is as follows:

package main
import (
    "fmt"
    "math/rand"
)
func main() {
    max := big.NewInt(100)
    i, err := rand.Int(rand.Reader, max)
}

I hope this article has been helpful to your programming of Go language.


Related articles: