initialize seed of the global random generator using unix timestamp

The algorithm for generating temporary paths is not cryptographically safe,
but this is enough in real situation.
This commit is contained in:
itchyny 2021-01-08 20:09:10 +09:00
parent 5ac7f7d75f
commit 5ee3f57dff

View file

@ -5,10 +5,12 @@ import (
"flag"
"fmt"
"io/ioutil"
"math/rand"
"os"
"os/exec"
"runtime"
"strings"
"time"
_ "github.com/mattn/getwild"
"github.com/mattn/go-tty"
@ -22,6 +24,10 @@ const version = "0.1.2"
var revision = "HEAD"
func init() {
rand.Seed(time.Now().UnixNano())
}
func main() {
os.Exit(run(os.Args[1:]))
}