Skip to content

Commit

Permalink
go: tidy up with gofmt
Browse files Browse the repository at this point in the history
  • Loading branch information
rmg committed Aug 5, 2019
1 parent 8f9e979 commit 41cd7d2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
package main

import (
"io"
"fmt"
"io"
"log"
"os"
"runtime/pprof"
"runtime"
"runtime/pprof"
)

const BUF = 64*1024 *1024
const BUF = 64 * 1024 * 1024

func searchWrite(buf []byte, out io.Writer) int {
count := 0
for i, b := range buf {
switch {
case b >= '0' && b <= '9': fallthrough
case b >= '0' && b <= '9':
fallthrough
case b >= 'a' && b <= 'f':
count += 1
default:
Expand All @@ -29,7 +30,7 @@ func searchWrite(buf []byte, out io.Writer) int {
}
}
if count == 40 {
right := len(buf)-1
right := len(buf) - 1
left := right - count
out.Write(buf[left:right])
out.Write([]byte{'\n'})
Expand All @@ -51,7 +52,7 @@ func scan(input io.Reader) {
if err == io.EOF {
break
}
off = searchWrite(curr[:off + n], os.Stdout)
off = searchWrite(curr[:off+n], os.Stdout)
if off > 0 {
copy(curr[:off], curr[n-off:n])
}
Expand Down

0 comments on commit 41cd7d2

Please sign in to comment.