diff --git a/selector/default_node.go b/selector/default_node.go index 186629e78..3554a3a13 100644 --- a/selector/default_node.go +++ b/selector/default_node.go @@ -6,6 +6,8 @@ import ( "github.com/go-kratos/kratos/v2/registry" ) +var _ Node = (*DefaultNode)(nil) + // DefaultNode is selector node type DefaultNode struct { scheme string diff --git a/selector/default_selector.go b/selector/default_selector.go index 247af2e92..83b1ce9e6 100644 --- a/selector/default_selector.go +++ b/selector/default_selector.go @@ -5,6 +5,11 @@ import ( "sync/atomic" ) +var ( + _ Rebalancer = (*Default)(nil) + _ Builder = (*DefaultBuilder)(nil) +) + // Default is composite selector. type Default struct { NodeBuilder WeightedNodeBuilder diff --git a/selector/node/direct/direct.go b/selector/node/direct/direct.go index 62b30ed7f..d32fc3148 100644 --- a/selector/node/direct/direct.go +++ b/selector/node/direct/direct.go @@ -13,8 +13,8 @@ const ( ) var ( - _ selector.WeightedNode = &Node{} - _ selector.WeightedNodeBuilder = &Builder{} + _ selector.WeightedNode = (*Node)(nil) + _ selector.WeightedNodeBuilder = (*Builder)(nil) ) // Node is endpoint instance diff --git a/selector/node/ewma/node.go b/selector/node/ewma/node.go index 1707f1083..4fed4aaa2 100644 --- a/selector/node/ewma/node.go +++ b/selector/node/ewma/node.go @@ -21,8 +21,8 @@ const ( ) var ( - _ selector.WeightedNode = &Node{} - _ selector.WeightedNodeBuilder = &Builder{} + _ selector.WeightedNode = (*Node)(nil) + _ selector.WeightedNodeBuilder = (*Builder)(nil) ) // Node is endpoint instance