1
0
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:
jesse.tang 2022-09-14 22:05:48 +08:00 committed by GitHub
parent ae505063fe
commit f2a33929d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 12 additions and 12 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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")

View File

@ -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

View File

@ -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

View File

@ -14,7 +14,7 @@ import (
"go.opentelemetry.io/otel/trace"
)
var _ transport.Transporter = &mockTransport{}
var _ transport.Transporter = (*mockTransport)(nil)
type headerCarrier http.Header

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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 {

View File

@ -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 {