fix: modify interface check way (#2375)

* fix: modify interface check way

* fix
pull/2376/head
jesse.tang 2 years ago committed by GitHub
parent ae505063fe
commit f2a33929d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      contrib/registry/etcd/watcher.go
  2. 2
      contrib/registry/eureka/client.go
  3. 2
      contrib/registry/eureka/watcher.go
  4. 2
      contrib/registry/zookeeper/watcher.go
  5. 2
      middleware/logging/logging_test.go
  6. 2
      middleware/selector/selector_test.go
  7. 2
      middleware/tracing/tracing_test.go
  8. 2
      selector/p2c/p2c.go
  9. 2
      selector/random/random.go
  10. 2
      selector/wrr/wrr.go
  11. 2
      transport/grpc/transport.go
  12. 2
      transport/http/transport.go

@ -7,7 +7,7 @@ import (
clientv3 "go.etcd.io/etcd/client/v3" clientv3 "go.etcd.io/etcd/client/v3"
) )
var _ registry.Watcher = &watcher{} var _ registry.Watcher = (*watcher)(nil)
type watcher struct { type watcher struct {
key string key string

@ -82,7 +82,7 @@ type DataCenterInfo struct {
Class string `json:"@class"` Class string `json:"@class"`
} }
var _ APIInterface = new(Client) var _ APIInterface = (*Client)(nil)
type APIInterface interface { type APIInterface interface {
Register(ctx context.Context, ep Endpoint) error Register(ctx context.Context, ep Endpoint) error

@ -6,7 +6,7 @@ import (
"github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/registry"
) )
var _ registry.Watcher = &watcher{} var _ registry.Watcher = (*watcher)(nil)
type watcher struct { type watcher struct {
ctx context.Context ctx context.Context

@ -10,7 +10,7 @@ import (
"github.com/go-zookeeper/zk" "github.com/go-zookeeper/zk"
) )
var _ registry.Watcher = &watcher{} var _ registry.Watcher = (*watcher)(nil)
var ErrWatcherStopped = errors.New("watcher stopped") var ErrWatcherStopped = errors.New("watcher stopped")

@ -11,7 +11,7 @@ import (
"github.com/go-kratos/kratos/v2/transport" "github.com/go-kratos/kratos/v2/transport"
) )
var _ transport.Transporter = &Transport{} var _ transport.Transporter = (*Transport)(nil)
type Transport struct { type Transport struct {
kind transport.Kind kind transport.Kind

@ -10,7 +10,7 @@ import (
"github.com/go-kratos/kratos/v2/transport" "github.com/go-kratos/kratos/v2/transport"
) )
var _ transport.Transporter = &Transport{} var _ transport.Transporter = (*Transport)(nil)
type Transport struct { type Transport struct {
kind transport.Kind kind transport.Kind

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

@ -17,7 +17,7 @@ const (
Name = "p2c" Name = "p2c"
) )
var _ selector.Balancer = &Balancer{} var _ selector.Balancer = (*Balancer)(nil)
// Option is random builder option. // Option is random builder option.
type Option func(o *options) type Option func(o *options)

@ -13,7 +13,7 @@ const (
Name = "random" Name = "random"
) )
var _ selector.Balancer = &Balancer{} // Name is balancer name var _ selector.Balancer = (*Balancer)(nil) // Name is balancer name
// Option is random builder option. // Option is random builder option.
type Option func(o *options) type Option func(o *options)

@ -13,7 +13,7 @@ const (
Name = "wrr" Name = "wrr"
) )
var _ selector.Balancer = &Balancer{} // Name is balancer name var _ selector.Balancer = (*Balancer)(nil) // Name is balancer name
// Option is random builder option. // Option is random builder option.
type Option func(o *options) type Option func(o *options)

@ -6,7 +6,7 @@ import (
"google.golang.org/grpc/metadata" "google.golang.org/grpc/metadata"
) )
var _ transport.Transporter = &Transport{} var _ transport.Transporter = (*Transport)(nil)
// Transport is a gRPC transport. // Transport is a gRPC transport.
type Transport struct { type Transport struct {

@ -7,7 +7,7 @@ import (
"github.com/go-kratos/kratos/v2/transport" "github.com/go-kratos/kratos/v2/transport"
) )
var _ Transporter = &Transport{} var _ Transporter = (*Transport)(nil)
// Transporter is http Transporter // Transporter is http Transporter
type Transporter interface { type Transporter interface {

Loading…
Cancel
Save