Procházet zdrojové kódy

Gofmt; make capgensound produce gofmt'ed output.

Dmitry Chestnykh před 11 roky
rodič
revize
31461913ba
4 změnil soubory, kde provedl 5 přidání a 6 odebrání
  1. 1 1
      capgensounds/main.go
  2. 1 1
      captcha.go
  3. 3 3
      sounds.go
  4. 0 1
      store_test.go

+ 1 - 1
capgensounds/main.go

@@ -57,7 +57,7 @@ func writeSingle(pcm io.Writer, name string) {
 }
 
 func writeDigitSounds(pcm io.Writer, lang string) {
-	fmt.Fprintf(pcm, "\t\"%s\" : [][]byte{\n", lang)
+	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, filepath.Join(lang, fmt.Sprintf("%d.wav", i)), "\t\t\t")

+ 1 - 1
captcha.go

@@ -128,7 +128,7 @@ func WriteAudio(w io.Writer, id string, lang string) error {
 
 // Verify returns true if the given digits are the ones that were used to
 // create the given captcha id.
-// 
+//
 // The function deletes the captcha with the given id from the internal
 // storage, so that the same captcha can't be verified anymore.
 func Verify(id string, digits []byte) bool {

+ 3 - 3
sounds.go

@@ -12,7 +12,7 @@ var waveHeader = []byte{
 // Byte slices contain raw 8 kHz unsigned 8-bit PCM data (without wav header).
 
 var digitSounds = map[string][][]byte{
-	"en" : [][]byte{
+	"en": [][]byte{
 		{ // 0
 			0x80, 0x7f, 0x80, 0x7f, 0x80, 0x80, 0x80, 0x7f, 0x80, 0x7f, 0x80,
 			0x7f, 0x80, 0x7f, 0x80, 0x7f, 0x80, 0x7f, 0x80, 0x80, 0x7f, 0x80,
@@ -2142,7 +2142,7 @@ var digitSounds = map[string][][]byte{
 			0x80, 0x7f, 0x80, 0x7f, 0x80, 0x80, 0x7f, 0x80, 0x7f,
 		},
 	},
-	"ru" : [][]byte{
+	"ru": [][]byte{
 		{ // 0
 			0x7f, 0x7f, 0x7e, 0x7f, 0x7f, 0x7e, 0x7f, 0x7e, 0x7f, 0x7f, 0x7e,
 			0x7f, 0x7e, 0x7f, 0x7d, 0x7e, 0x7d, 0x7e, 0x7e, 0x7e, 0x7d, 0x7e,
@@ -4607,7 +4607,7 @@ var digitSounds = map[string][][]byte{
 			0x80, 0x7f, 0x80, 0x80, 0x7f, 0x80, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
 		},
 	},
-	"zh" : [][]byte{
+	"zh": [][]byte{
 		{ // 0
 			0x7f, 0x80, 0x7f, 0x80, 0x80, 0x7f, 0x80, 0x7f, 0x80, 0x7f, 0x80,
 			0x7f, 0x80, 0x7f, 0x7f, 0x80, 0x7f, 0x80, 0x7f, 0x80, 0x7f, 0x80,

+ 0 - 1
store_test.go

@@ -61,7 +61,6 @@ func TestCollect(t *testing.T) {
 	}
 }
 
-
 func BenchmarkSetCollect(b *testing.B) {
 	b.StopTimer()
 	d := RandomDigits(10)