mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
*: fix gofmt
This commit is contained in:
parent
94745a4eed
commit
81fc7c23c2
@ -25,13 +25,13 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
|
||||||
"github.com/coreos/etcd/clientv3/balancer"
|
"github.com/coreos/etcd/clientv3/balancer"
|
||||||
"github.com/coreos/etcd/clientv3/balancer/picker"
|
"github.com/coreos/etcd/clientv3/balancer/picker"
|
||||||
"github.com/coreos/etcd/clientv3/balancer/resolver/endpoint"
|
"github.com/coreos/etcd/clientv3/balancer/resolver/endpoint"
|
||||||
"github.com/coreos/etcd/clientv3/credentials"
|
"github.com/coreos/etcd/clientv3/credentials"
|
||||||
"github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
|
"github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
|
||||||
"github.com/coreos/etcd/pkg/logutil"
|
"github.com/coreos/etcd/pkg/logutil"
|
||||||
|
"github.com/google/uuid"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
|
@ -17,9 +17,9 @@ package concurrency_test
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"log"
|
"log"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/coreos/etcd/clientv3"
|
"github.com/coreos/etcd/clientv3"
|
||||||
"github.com/coreos/etcd/clientv3/concurrency"
|
"github.com/coreos/etcd/clientv3/concurrency"
|
||||||
|
@ -273,17 +273,17 @@ func NewConfig() *Config {
|
|||||||
TickMs: 100,
|
TickMs: 100,
|
||||||
ElectionMs: 1000,
|
ElectionMs: 1000,
|
||||||
InitialElectionTickAdvance: true,
|
InitialElectionTickAdvance: true,
|
||||||
LPUrls: []url.URL{*lpurl},
|
LPUrls: []url.URL{*lpurl},
|
||||||
LCUrls: []url.URL{*lcurl},
|
LCUrls: []url.URL{*lcurl},
|
||||||
APUrls: []url.URL{*apurl},
|
APUrls: []url.URL{*apurl},
|
||||||
ACUrls: []url.URL{*acurl},
|
ACUrls: []url.URL{*acurl},
|
||||||
ClusterState: ClusterStateFlagNew,
|
ClusterState: ClusterStateFlagNew,
|
||||||
InitialClusterToken: "etcd-cluster",
|
InitialClusterToken: "etcd-cluster",
|
||||||
StrictReconfigCheck: DefaultStrictReconfigCheck,
|
StrictReconfigCheck: DefaultStrictReconfigCheck,
|
||||||
LogOutput: DefaultLogOutput,
|
LogOutput: DefaultLogOutput,
|
||||||
Metrics: "basic",
|
Metrics: "basic",
|
||||||
EnableV2: DefaultEnableV2,
|
EnableV2: DefaultEnableV2,
|
||||||
AuthToken: "simple",
|
AuthToken: "simple",
|
||||||
}
|
}
|
||||||
cfg.InitialCluster = cfg.InitialClusterFromName(cfg.Name)
|
cfg.InitialCluster = cfg.InitialClusterFromName(cfg.Name)
|
||||||
return cfg
|
return cfg
|
||||||
|
@ -73,11 +73,11 @@ func handleV2(mux *http.ServeMux, server etcdserver.ServerV2, timeout time.Durat
|
|||||||
}
|
}
|
||||||
|
|
||||||
mh := &membersHandler{
|
mh := &membersHandler{
|
||||||
sec: sec,
|
sec: sec,
|
||||||
server: server,
|
server: server,
|
||||||
cluster: server.Cluster(),
|
cluster: server.Cluster(),
|
||||||
timeout: timeout,
|
timeout: timeout,
|
||||||
clock: clockwork.NewRealClock(),
|
clock: clockwork.NewRealClock(),
|
||||||
clientCertAuthEnabled: server.ClientCertAuthEnabled(),
|
clientCertAuthEnabled: server.ClientCertAuthEnabled(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,4 +92,4 @@ func createResponse(dataSize, events int) (resp *pb.WatchResponse) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return resp
|
return resp
|
||||||
}
|
}
|
||||||
|
@ -189,8 +189,8 @@ func TestWALDir(t *testing.T) {
|
|||||||
|
|
||||||
func TestShouldDiscover(t *testing.T) {
|
func TestShouldDiscover(t *testing.T) {
|
||||||
tests := map[string]bool{
|
tests := map[string]bool{
|
||||||
"": false,
|
"": false,
|
||||||
"foo": true,
|
"foo": true,
|
||||||
"http://discovery.etcd.io/asdf": true,
|
"http://discovery.etcd.io/asdf": true,
|
||||||
}
|
}
|
||||||
for durl, w := range tests {
|
for durl, w := range tests {
|
||||||
|
@ -61,10 +61,10 @@ func NewServer(
|
|||||||
address string,
|
address string,
|
||||||
) *Server {
|
) *Server {
|
||||||
return &Server{
|
return &Server{
|
||||||
lg: lg,
|
lg: lg,
|
||||||
network: network,
|
network: network,
|
||||||
address: address,
|
address: address,
|
||||||
last: rpcpb.Operation_NOT_STARTED,
|
last: rpcpb.Operation_NOT_STARTED,
|
||||||
advertiseClientPortToProxy: make(map[int]proxy.Server),
|
advertiseClientPortToProxy: make(map[int]proxy.Server),
|
||||||
advertisePeerPortToProxy: make(map[int]proxy.Server),
|
advertisePeerPortToProxy: make(map[int]proxy.Server),
|
||||||
}
|
}
|
||||||
|
@ -292,7 +292,7 @@ func (b *backend) Defrag() error {
|
|||||||
|
|
||||||
func (b *backend) defrag() error {
|
func (b *backend) defrag() error {
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
|
|
||||||
// TODO: make this non-blocking?
|
// TODO: make this non-blocking?
|
||||||
// lock batchTx to ensure nobody is using previous tx, and then
|
// lock batchTx to ensure nobody is using previous tx, and then
|
||||||
// close previous ongoing tx.
|
// close previous ongoing tx.
|
||||||
|
@ -70,13 +70,13 @@ func CheckAfterTest(d time.Duration) error {
|
|||||||
}
|
}
|
||||||
var bad string
|
var bad string
|
||||||
badSubstring := map[string]string{
|
badSubstring := map[string]string{
|
||||||
").writeLoop(": "a Transport",
|
").writeLoop(": "a Transport",
|
||||||
"created by net/http/httptest.(*Server).Start": "an httptest.Server",
|
"created by net/http/httptest.(*Server).Start": "an httptest.Server",
|
||||||
"timeoutHandler": "a TimeoutHandler",
|
"timeoutHandler": "a TimeoutHandler",
|
||||||
"net.(*netFD).connect(": "a timing out dial",
|
"net.(*netFD).connect(": "a timing out dial",
|
||||||
").noteClientGone(": "a closenotifier sender",
|
").noteClientGone(": "a closenotifier sender",
|
||||||
").readLoop(": "a Transport",
|
").readLoop(": "a Transport",
|
||||||
".grpc": "a gRPC resource",
|
".grpc": "a gRPC resource",
|
||||||
}
|
}
|
||||||
|
|
||||||
var stacks string
|
var stacks string
|
||||||
|
@ -175,10 +175,10 @@ func TestRemoveSingleHopHeaders(t *testing.T) {
|
|||||||
"Keep-Alive": {"foo"},
|
"Keep-Alive": {"foo"},
|
||||||
"Proxy-Authenticate": {"Basic realm=example.com"},
|
"Proxy-Authenticate": {"Basic realm=example.com"},
|
||||||
"Proxy-Authorization": {"foo"},
|
"Proxy-Authorization": {"foo"},
|
||||||
"Te": {"deflate,gzip"},
|
"Te": {"deflate,gzip"},
|
||||||
"Trailers": {"ETag"},
|
"Trailers": {"ETag"},
|
||||||
"Transfer-Encoding": {"chunked"},
|
"Transfer-Encoding": {"chunked"},
|
||||||
"Upgrade": {"WebSocket"},
|
"Upgrade": {"WebSocket"},
|
||||||
|
|
||||||
// headers that should persist
|
// headers that should persist
|
||||||
"Accept": {"application/json"},
|
"Accept": {"application/json"},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user