all repos — captcha @ cacbe12b17c2ad0c3342312b177443645fee6f89

Go package captcha implements generation and verification of image and audio CAPTCHAs.

generate: use filepath instead of path.
Dmitry Chestnykh dmitry@codingrobots.com
Thu, 12 May 2011 12:59:58 +0200
commit

cacbe12b17c2ad0c3342312b177443645fee6f89

parent

9d0ab4e0254bd6f8ce9aa950ebb90956b1764fc9

1 files changed, 3 insertions(+), 3 deletions(-)

jump to
M generate/main.gogenerate/main.go

@@ -9,7 +9,7 @@ "os"

"io" "io/ioutil" "log" - "path" + "path/filepath" ) const headerLen = 44

@@ -56,14 +56,14 @@ func writeDigitSounds(pcm io.Writer, lang string) {

fmt.Fprintf(pcm, "\t\"%s\" : [][]byte{\n", lang) for i := 0; i <= 9; i++ { fmt.Fprintf(pcm, "\t\t{ // %d\n\t\t\t", i) - writeFileRep(pcm, path.Join(lang, fmt.Sprintf("%d.wav", i)), "\t\t\t") + writeFileRep(pcm, filepath.Join(lang, fmt.Sprintf("%d.wav", i)), "\t\t\t") fmt.Fprintf(pcm, "\t\t},\n") } fmt.Fprintf(pcm, "\t},\n") } func main() { - pcm, err := os.Create(path.Join("..", "sounds.go")) + pcm, err := os.Create(filepath.Join("..", "sounds.go")) if err != nil { log.Fatalf("%s", err) }