mirror of
https://github.com/go-kratos/kratos.git
synced 2025-01-14 02:33:03 +02:00
fix: modify interface check way (#2375)
* fix: modify interface check way * fix
This commit is contained in:
parent
ae505063fe
commit
f2a33929d0
@ -7,7 +7,7 @@ import (
|
||||
clientv3 "go.etcd.io/etcd/client/v3"
|
||||
)
|
||||
|
||||
var _ registry.Watcher = &watcher{}
|
||||
var _ registry.Watcher = (*watcher)(nil)
|
||||
|
||||
type watcher struct {
|
||||
key string
|
||||
|
@ -82,7 +82,7 @@ type DataCenterInfo struct {
|
||||
Class string `json:"@class"`
|
||||
}
|
||||
|
||||
var _ APIInterface = new(Client)
|
||||
var _ APIInterface = (*Client)(nil)
|
||||
|
||||
type APIInterface interface {
|
||||
Register(ctx context.Context, ep Endpoint) error
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"github.com/go-kratos/kratos/v2/registry"
|
||||
)
|
||||
|
||||
var _ registry.Watcher = &watcher{}
|
||||
var _ registry.Watcher = (*watcher)(nil)
|
||||
|
||||
type watcher struct {
|
||||
ctx context.Context
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
"github.com/go-zookeeper/zk"
|
||||
)
|
||||
|
||||
var _ registry.Watcher = &watcher{}
|
||||
var _ registry.Watcher = (*watcher)(nil)
|
||||
|
||||
var ErrWatcherStopped = errors.New("watcher stopped")
|
||||
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
"github.com/go-kratos/kratos/v2/transport"
|
||||
)
|
||||
|
||||
var _ transport.Transporter = &Transport{}
|
||||
var _ transport.Transporter = (*Transport)(nil)
|
||||
|
||||
type Transport struct {
|
||||
kind transport.Kind
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
"github.com/go-kratos/kratos/v2/transport"
|
||||
)
|
||||
|
||||
var _ transport.Transporter = &Transport{}
|
||||
var _ transport.Transporter = (*Transport)(nil)
|
||||
|
||||
type Transport struct {
|
||||
kind transport.Kind
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
)
|
||||
|
||||
var _ transport.Transporter = &mockTransport{}
|
||||
var _ transport.Transporter = (*mockTransport)(nil)
|
||||
|
||||
type headerCarrier http.Header
|
||||
|
||||
|
@ -17,7 +17,7 @@ const (
|
||||
Name = "p2c"
|
||||
)
|
||||
|
||||
var _ selector.Balancer = &Balancer{}
|
||||
var _ selector.Balancer = (*Balancer)(nil)
|
||||
|
||||
// Option is random builder option.
|
||||
type Option func(o *options)
|
||||
|
@ -13,7 +13,7 @@ const (
|
||||
Name = "random"
|
||||
)
|
||||
|
||||
var _ selector.Balancer = &Balancer{} // Name is balancer name
|
||||
var _ selector.Balancer = (*Balancer)(nil) // Name is balancer name
|
||||
|
||||
// Option is random builder option.
|
||||
type Option func(o *options)
|
||||
|
@ -13,7 +13,7 @@ const (
|
||||
Name = "wrr"
|
||||
)
|
||||
|
||||
var _ selector.Balancer = &Balancer{} // Name is balancer name
|
||||
var _ selector.Balancer = (*Balancer)(nil) // Name is balancer name
|
||||
|
||||
// Option is random builder option.
|
||||
type Option func(o *options)
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"google.golang.org/grpc/metadata"
|
||||
)
|
||||
|
||||
var _ transport.Transporter = &Transport{}
|
||||
var _ transport.Transporter = (*Transport)(nil)
|
||||
|
||||
// Transport is a gRPC transport.
|
||||
type Transport struct {
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
"github.com/go-kratos/kratos/v2/transport"
|
||||
)
|
||||
|
||||
var _ Transporter = &Transport{}
|
||||
var _ Transporter = (*Transport)(nil)
|
||||
|
||||
// Transporter is http Transporter
|
||||
type Transporter interface {
|
||||
|
Loading…
Reference in New Issue
Block a user