From e273c5188a60927ddacf5657a34b3a45d1020d64 Mon Sep 17 00:00:00 2001 From: yonwoo9 <50109209+yonwoo9@users.noreply.github.com> Date: Sun, 26 Mar 2023 22:52:49 +0800 Subject: [PATCH] chore: update comment (#2747) Co-authored-by: haiyux --- contrib/registry/servicecomb/watcher.go | 3 ++- selector/p2c/p2c.go | 6 +++--- selector/wrr/wrr.go | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/contrib/registry/servicecomb/watcher.go b/contrib/registry/servicecomb/watcher.go index b1f4fccfa..cc4545ccc 100644 --- a/contrib/registry/servicecomb/watcher.go +++ b/contrib/registry/servicecomb/watcher.go @@ -1,8 +1,9 @@ package servicecomb import ( + "context" + "github.com/go-chassis/sc-client" - "golang.org/x/net/context" "github.com/go-kratos/kratos/v2/registry" ) diff --git a/selector/p2c/p2c.go b/selector/p2c/p2c.go index 1d0ef8c56..afca98079 100644 --- a/selector/p2c/p2c.go +++ b/selector/p2c/p2c.go @@ -13,16 +13,16 @@ import ( const ( forcePick = time.Second * 3 - // Name is balancer name + // Name is p2c(Pick of 2 choices) balancer name Name = "p2c" ) var _ selector.Balancer = (*Balancer)(nil) -// Option is random builder option. +// Option is p2c builder option. type Option func(o *options) -// options is random builder options +// options is p2c builder options type options struct{} // New creates a p2c selector. diff --git a/selector/wrr/wrr.go b/selector/wrr/wrr.go index 3d91d62e3..f81d71714 100644 --- a/selector/wrr/wrr.go +++ b/selector/wrr/wrr.go @@ -9,19 +9,19 @@ import ( ) const ( - // Name is wrr balancer name + // Name is wrr(Weighted Round Robin) balancer name Name = "wrr" ) var _ selector.Balancer = (*Balancer)(nil) // Name is balancer name -// Option is random builder option. +// Option is wrr builder option. type Option func(o *options) -// options is random builder options +// options is wrr builder options type options struct{} -// Balancer is a random balancer. +// Balancer is a wrr balancer. type Balancer struct { mu sync.Mutex currentWeight map[string]float64