Fix comments, apply gofmt.
Dmitry Chestnykh dmitry@codingrobots.com
Sun, 24 Apr 2011 22:49:14 +0200
5 files changed,
8 insertions(+),
11 deletions(-)
M
captcha.go
→
captcha.go
@@ -11,10 +11,10 @@
const ( // Standard number of digits in captcha. StdLength = 6 - // The number of captchas created that triggers garbage collection + // The number of captchas created that triggers garbage collection. StdCollectNum = 100 - // Expiration time of captchas - StdExpiration = 2*60 // 2 minutes + // Expiration time of captchas. + StdExpiration = 2 * 60 // 2 minutes )@@ -28,7 +28,7 @@ // digits in range 0-9.
func RandomDigits(length int) []byte { d := make([]byte, length) if _, err := io.ReadFull(rand.Reader, d); err != nil { - panic(err) + panic("error reading random source: " + err.String()) } for i := range d { d[i] %= 10@@ -99,8 +99,7 @@ // storage. It is called automatically by New function every CollectNum
// generated captchas, but still exported to enable freeing memory manually if // needed. // -// Collection is launched in a new goroutine, so this function returns -// immediately. +// Collection is launched in a new goroutine. func Collect() { go globalStore.collect() }
M
generate/main.go
→
generate/main.go
@@ -67,7 +67,7 @@ log.Fatalf("%s", err)
} defer pcm.Close() fmt.Fprintf(pcm, `package captcha - + // This file has been generated from .wav files using generate.go. var waveHeader = []byte{