mirror of
				https://github.com/golang/go.git
				synced 2025-11-04 02:30:57 +00:00 
			
		
		
		
	doc: fix codewalk/markov.go
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
This commit is contained in:
		
							parent
							
								
									4853cb9ab0
								
							
						
					
					
						commit
						932cdfbc4c
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -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.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue