lint: remove dot import (go-common)

Spell out the package explicitly.
This commit is totally textual, and does not change any logic.

The swiss-army knife package may serve a kick-start in early
stage development. But as the codebase growing, we might want
to retire it gradually:

  For simple wrapping functions, just inline it on the call site.
  For larger pice of code, make it an independent package.
This commit is contained in:
Tzu-Jung Lee
2017-01-16 22:48:24 -08:00
parent c65bb21a51
commit fcaa545e1e
20 changed files with 98 additions and 99 deletions

View File

@ -11,7 +11,7 @@ import (
"time"
"github.com/tendermint/abci/types"
. "github.com/tendermint/go-common"
common "github.com/tendermint/go-common"
)
const (
@ -27,10 +27,10 @@ const flushThrottleMS = 20 // Don't wait longer than...
// the application in general is not meant to be interfaced
// with concurrent callers.
type socketClient struct {
BaseService
common.BaseService
reqQueue chan *ReqRes
flushTimer *ThrottleTimer
flushTimer *common.ThrottleTimer
mustConnect bool
mtx sync.Mutex
@ -45,14 +45,14 @@ type socketClient struct {
func NewSocketClient(addr string, mustConnect bool) (*socketClient, error) {
cli := &socketClient{
reqQueue: make(chan *ReqRes, reqQueueSize),
flushTimer: NewThrottleTimer("socketClient", flushThrottleMS),
flushTimer: common.NewThrottleTimer("socketClient", flushThrottleMS),
mustConnect: mustConnect,
addr: addr,
reqSent: list.New(),
resCb: nil,
}
cli.BaseService = *NewBaseService(nil, "socketClient", cli)
cli.BaseService = *common.NewBaseService(nil, "socketClient", cli)
_, err := cli.Start() // Just start it, it's confusing for callers to remember to start.
return cli, err
@ -65,12 +65,12 @@ func (cli *socketClient) OnStart() error {
var conn net.Conn
RETRY_LOOP:
for {
conn, err = Connect(cli.addr)
conn, err = common.Connect(cli.addr)
if err != nil {
if cli.mustConnect {
return err
} else {
log.Warn(Fmt("abci.socketClient failed to connect to %v. Retrying...", cli.addr))
log.Warn(common.Fmt("abci.socketClient failed to connect to %v. Retrying...", cli.addr))
time.Sleep(time.Second * 3)
continue RETRY_LOOP
}
@ -109,7 +109,7 @@ func (cli *socketClient) StopForError(err error) {
}
cli.mtx.Unlock()
log.Warn(Fmt("Stopping abci.socketClient for error: %v", err.Error()))
log.Warn(common.Fmt("Stopping abci.socketClient for error: %v", err.Error()))
cli.Stop()
}