]> Cypherpunks repositories - gostls13.git/commitdiff
doc: fix codewalk/markov.go
authorLai Jiangshan <eag0628@gmail.com>
Wed, 15 Feb 2012 02:07:34 +0000 (13:07 +1100)
committerAndrew Gerrand <adg@golang.org>
Wed, 15 Feb 2012 02:07:34 +0000 (13:07 +1100)
When I build it, I got:
/home/njubee/work/golang/doc/codewalk/markov.go:124: undefined: time.Nanoseconds
time.Nanoseconds() does not exist now, use time.Now().UnixNano() instead

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5668044

doc/codewalk/markov.go

index cb28eb0bccd5dbce88b31b9eeb4e3fa27187b627..a8f322eb6b26370811ddf88376d5db620a3aa30c 100644 (file)
@@ -120,8 +120,8 @@ func main() {
        numWords := flag.Int("words", 100, "maximum number of words to print")
        prefixLen := flag.Int("prefix", 2, "prefix length in words")
 
-       flag.Parse()                  // Parse command-line flags.
-       rand.Seed(time.Nanoseconds()) // Seed the random number generator.
+       flag.Parse()                     // Parse command-line flags.
+       rand.Seed(time.Now().UnixNano()) // Seed the random number generator.
 
        c := NewChain(*prefixLen)     // Initialize a new Chain.
        c.Build(os.Stdin)             // Build chains from standard input.