瀏覽代碼

supporting Go1

drhodes 13 年之前
父節點
當前提交
75c66cd673
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      lorem.go

+ 2 - 3
lorem.go

@@ -5,17 +5,16 @@
 package lorem
 
 import (
-	"rand"
+	"math/rand"
 	"time"
 	"strings"
 )
 
-var src = rand.New(rand.NewSource(time.Nanoseconds()))
+var src = rand.New(rand.NewSource(int64(time.Now().Nanosecond())))
 
 // Generate a natural word len.
 func genWordLen() int {
 	f := src.Float32() * 100
-
 	// a table of word lengths and their frequencies.
 	switch {
 	case f < 1.939: