Skip to content

Commit

Permalink
fix lint conversion QL
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed Oct 12, 2024
1 parent dd3681f commit 14a136e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions local-interchain/interchain/handlers/log_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func TailFile(logger *zap.Logger, logFile string, lines uint64) []string {
reader := bufio.NewReader(file)

var logs []string
for i := 0; i < int(totalLines)-int(lines); i++ {
for i := 0; uint64(i) < totalLines-lines; i++ {
_, _, err := reader.ReadLine()
if err != nil {
logger.Fatal("error reading log file", zap.Error(err))
Expand All @@ -146,14 +146,14 @@ func TailFile(logger *zap.Logger, logFile string, lines uint64) []string {
return logs
}

func lineCounter(r io.Reader) (int, error) {
func lineCounter(r io.Reader) (uint64, error) {
buf := make([]byte, 32*1024)
count := 0
var count uint64 = 0
lineSep := []byte{'\n'}

for {
c, err := r.Read(buf)
count += bytes.Count(buf[:c], lineSep)
count += uint64(bytes.Count(buf[:c], lineSep))

switch {
case err == io.EOF:
Expand Down

0 comments on commit 14a136e

Please sign in to comment.