mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-05 23:57:04 +00:00
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:
@@ -3,17 +3,16 @@ package main
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
//"encoding/hex"
|
||||
|
||||
"github.com/tendermint/abci/types"
|
||||
. "github.com/tendermint/go-common"
|
||||
common "github.com/tendermint/go-common"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
conn, err := Connect("unix://test.sock")
|
||||
conn, err := common.Connect("unix://test.sock")
|
||||
if err != nil {
|
||||
Exit(err.Error())
|
||||
common.Exit(err.Error())
|
||||
}
|
||||
|
||||
// Read a bunch of responses
|
||||
@@ -23,7 +22,7 @@ func main() {
|
||||
var res = &types.Response{}
|
||||
err := types.ReadMessage(conn, res)
|
||||
if err != nil {
|
||||
Exit(err.Error())
|
||||
common.Exit(err.Error())
|
||||
}
|
||||
counter += 1
|
||||
if counter%1000 == 0 {
|
||||
@@ -40,11 +39,11 @@ func main() {
|
||||
|
||||
err := types.WriteMessage(req, bufWriter)
|
||||
if err != nil {
|
||||
Exit(err.Error())
|
||||
common.Exit(err.Error())
|
||||
}
|
||||
err = bufWriter.Flush()
|
||||
if err != nil {
|
||||
Exit(err.Error())
|
||||
common.Exit(err.Error())
|
||||
}
|
||||
|
||||
counter += 1
|
||||
|
||||
@@ -6,17 +6,16 @@ import (
|
||||
"fmt"
|
||||
"net"
|
||||
"reflect"
|
||||
//"encoding/hex"
|
||||
|
||||
"github.com/tendermint/abci/types"
|
||||
. "github.com/tendermint/go-common"
|
||||
common "github.com/tendermint/go-common"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
conn, err := Connect("unix://test.sock")
|
||||
conn, err := common.Connect("unix://test.sock")
|
||||
if err != nil {
|
||||
Exit(err.Error())
|
||||
common.Exit(err.Error())
|
||||
}
|
||||
|
||||
// Make a bunch of requests
|
||||
@@ -25,7 +24,7 @@ func main() {
|
||||
req := types.ToRequestEcho("foobar")
|
||||
_, err := makeRequest(conn, req)
|
||||
if err != nil {
|
||||
Exit(err.Error())
|
||||
common.Exit(err.Error())
|
||||
}
|
||||
counter += 1
|
||||
if counter%1000 == 0 {
|
||||
@@ -63,7 +62,7 @@ func makeRequest(conn net.Conn, req *types.Request) (*types.Response, error) {
|
||||
return nil, err
|
||||
}
|
||||
if _, ok := resFlush.Value.(*types.Response_Flush); !ok {
|
||||
return nil, errors.New(Fmt("Expected flush response but got something else: %v", reflect.TypeOf(resFlush)))
|
||||
return nil, errors.New(common.Fmt("Expected flush response but got something else: %v", reflect.TypeOf(resFlush)))
|
||||
}
|
||||
|
||||
return res, nil
|
||||
|
||||
Reference in New Issue
Block a user