Skip to content

Instantly share code, notes, and snippets.

@yurimorales
Created October 11, 2017 20:06
Show Gist options
  • Save yurimorales/bfece5bcb112b911a6b036c9275ff63a to your computer and use it in GitHub Desktop.
Save yurimorales/bfece5bcb112b911a6b036c9275ff63a to your computer and use it in GitHub Desktop.
Random Number Go
package main
import (
"fmt"
"math/rand"
"time"
)
func randomNumber(min int, max int) int {
rand.Seed(time.Now().UnixNano())
foo := rand.Intn(max) + min
return foo
}
func main() {
retorno := randomNumber(1, 100)
fmt.Println("O numero randomico sorteado: ", retorno)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment