Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: gofmt related changes #389

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions loxinet/dpbroker.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ func (dp *DpH) WaitXsyncReady(who string) {

// DpXsyncRPC - Routine for syncing connection information with peers
func (dp *DpH) DpXsyncRPC(op DpSyncOpT, arg interface{}) int {
var reply,ret int
var reply, ret int
var err error

dp.SyncMtx.Lock()
Expand Down Expand Up @@ -578,7 +578,7 @@ func DpBrokerInit(dph DpHookInterface, rpcMode int) *DpH {
nDp.RPC = new(XSync)

nDp.RPC.RPCType = rpcMode
if (rpcMode == RPCTypeNetRPC) {
if rpcMode == RPCTypeNetRPC {
nDp.RPC.RPCHooks = &netRPCClient{}
} else {
nDp.RPC.RPCHooks = &gRPCClient{}
Expand Down
14 changes: 7 additions & 7 deletions loxinet/xsync_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ import (
"context"
"errors"
"fmt"
tk "github.com/loxilb-io/loxilib"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"io"
"net"
"net/http"
"net/rpc"
"time"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
tk "github.com/loxilb-io/loxilib"
)

type netRPCClient struct {
Expand Down Expand Up @@ -112,8 +112,8 @@ func (*netRPCClient) RPCClose(pe *DpPeer) int {

func (*netRPCClient) RPCSend(pe *DpPeer, rpcCallStr string, args any) (int, error) {
var reply int
client, _ := pe.Client.(*rpc.Client)
timeout := 2 * time.Second
client, _ := pe.Client.(*rpc.Client)
timeout := 2 * time.Second
call := client.Go(rpcCallStr, args, &reply, make(chan *rpc.Call, 1))
select {
case <-time.After(timeout):
Expand All @@ -122,7 +122,7 @@ func (*netRPCClient) RPCSend(pe *DpPeer, rpcCallStr string, args any) (int, erro
pe.Client.(*rpc.Client).Close()
}
pe.Client = nil

return reply, errors.New("netrpc call timeout")
case resp := <-call.Done:
if resp != nil && resp.Error != nil {
Expand Down Expand Up @@ -259,5 +259,5 @@ func (*gRPCClient) RPCSend(pe *DpPeer, rpcCallStr string, args any) (int, error)
var reply int
err := callGRPC(pe.Client.(gRPCClient).xclient, rpcCallStr, args, &reply)

return reply,err
return reply, err
}
2 changes: 1 addition & 1 deletion loxinet/xsync_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (
"net/rpc"
"runtime/debug"

"google.golang.org/grpc"
opts "github.com/loxilb-io/loxilb/options"
tk "github.com/loxilb-io/loxilib"
"google.golang.org/grpc"
)

// DpWorkOnBlockCtAdd - Add block CT entries from remote goRPC client
Expand Down