mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
node: all golint warnings fixed
This commit is contained in:
parent
415969f534
commit
60f22eb82b
5 changed files with 8 additions and 6 deletions
|
|
@ -217,7 +217,7 @@ func (api *PrivateAdminAPI) StartWS(host *string, port *int, allowedOrigins *str
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// StopRPC terminates an already running websocket RPC API endpoint.
|
// StopWS terminates an already running websocket RPC API endpoint.
|
||||||
func (api *PrivateAdminAPI) StopWS() (bool, error) {
|
func (api *PrivateAdminAPI) StopWS() (bool, error) {
|
||||||
api.node.lock.Lock()
|
api.node.lock.Lock()
|
||||||
defer api.node.lock.Unlock()
|
defer api.node.lock.Unlock()
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/p2p/nat"
|
"github.com/ethereum/go-ethereum/p2p/nat"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Const variables set HTTP and WS ports for localhost.
|
||||||
const (
|
const (
|
||||||
DefaultHTTPHost = "localhost" // Default host interface for the HTTP RPC server
|
DefaultHTTPHost = "localhost" // Default host interface for the HTTP RPC server
|
||||||
DefaultHTTPPort = 8545 // Default TCP port for the HTTP RPC server
|
DefaultHTTPPort = 8545 // Default TCP port for the HTTP RPC server
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import (
|
||||||
"syscall"
|
"syscall"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Var variables list errors generated.
|
||||||
var (
|
var (
|
||||||
ErrDatadirUsed = errors.New("datadir already used by another process")
|
ErrDatadirUsed = errors.New("datadir already used by another process")
|
||||||
ErrNodeStopped = errors.New("node not started")
|
ErrNodeStopped = errors.New("node not started")
|
||||||
|
|
|
||||||
|
|
@ -507,8 +507,8 @@ func TestAPIGather(t *testing.T) {
|
||||||
}
|
}
|
||||||
// Register a batch of services with some configured APIs
|
// Register a batch of services with some configured APIs
|
||||||
calls := make(chan string, 1)
|
calls := make(chan string, 1)
|
||||||
makeAPI := func(result string) *OneMethodApi {
|
makeAPI := func(result string) *OneMethodAPI {
|
||||||
return &OneMethodApi{fun: func() { calls <- result }}
|
return &OneMethodAPI{fun: func() { calls <- result }}
|
||||||
}
|
}
|
||||||
services := map[string]struct {
|
services := map[string]struct {
|
||||||
APIs []rpc.API
|
APIs []rpc.API
|
||||||
|
|
|
||||||
|
|
@ -121,12 +121,12 @@ func InstrumentedServiceMakerC(base ServiceConstructor) ServiceConstructor {
|
||||||
return InstrumentingWrapperMaker(base, reflect.TypeOf(InstrumentedServiceC{}))
|
return InstrumentingWrapperMaker(base, reflect.TypeOf(InstrumentedServiceC{}))
|
||||||
}
|
}
|
||||||
|
|
||||||
// OneMethodApi is a single-method API handler to be returned by test services.
|
// OneMethodAPI is a single-method API handler to be returned by test services.
|
||||||
type OneMethodApi struct {
|
type OneMethodAPI struct {
|
||||||
fun func()
|
fun func()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (api *OneMethodApi) TheOneMethod() {
|
func (api *OneMethodAPI) TheOneMethod() {
|
||||||
if api.fun != nil {
|
if api.fun != nil {
|
||||||
api.fun()
|
api.fun()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue