linting: add to Makefile & do some fixes

This commit is contained in:
Zach Ramsay
2017-09-22 11:42:29 -04:00
parent 2130c329eb
commit d6e03d2368
20 changed files with 82 additions and 51 deletions

View File

@ -1,12 +1,14 @@
// nolint: goimports
package autofile
import (
. "github.com/tendermint/tmlibs/common"
"os"
"sync/atomic"
"syscall"
"testing"
"time"
. "github.com/tendermint/tmlibs/common"
)
func TestSIGHUP(t *testing.T) {

View File

@ -107,7 +107,6 @@ func (g *Group) OnStart() error {
func (g *Group) OnStop() {
g.BaseService.OnStop()
g.ticker.Stop()
return
}
func (g *Group) SetHeadSizeLimit(limit int64) {
@ -568,8 +567,7 @@ func (gr *GroupReader) ReadLine() (string, error) {
bytesRead, err := gr.curReader.ReadBytes('\n')
if err == io.EOF {
// Open the next file
err := gr.openFile(gr.curIndex + 1)
if err != nil {
if err := gr.openFile(gr.curIndex + 1); err != nil {
return "", err
}
if len(bytesRead) > 0 && bytesRead[len(bytesRead)-1] == byte('\n') {

View File

@ -100,8 +100,7 @@ func TestCheckHeadSizeLimit(t *testing.T) {
// Write 1000 bytes 999 times.
for i := 0; i < 999; i++ {
err := g.WriteLine(RandStr(999))
if err != nil {
if err := g.WriteLine(RandStr(999)); err != nil {
t.Fatal("Error appending to head", err)
}
}

View File

@ -22,7 +22,7 @@ func initSighupWatcher() {
signal.Notify(c, syscall.SIGHUP)
go func() {
for _ = range c {
for range c {
sighupWatchers.closeAll()
atomic.AddInt32(&sighupCounter, 1)
}