Skip to content

Commit

Permalink
use pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
chickenlj committed Nov 4, 2023
1 parent da1db06 commit cbad419
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cluster/directory/base/directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ type Directory struct {
}

// NewDirectory Create BaseDirectory with URL
func NewDirectory(url *common.URL) Directory {
return Directory{
func NewDirectory(url *common.URL) *Directory {
return &Directory{
url: url,
destroyed: atomic.NewBool(false),
routerChain: &chain.RouterChain{},
Expand Down
2 changes: 1 addition & 1 deletion cluster/directory/static/directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
)

type directory struct {
base.Directory
*base.Directory
invokers []protocol.Invoker
}

Expand Down
8 changes: 4 additions & 4 deletions registry/directory/directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func init() {
// RegistryDirectory implementation of Directory:
// Invoker list returned from this Directory's list method have been filtered by Routers
type RegistryDirectory struct {
base.Directory
*base.Directory
cacheInvokers []protocol.Invoker
invokersLock sync.RWMutex
serviceType string
Expand Down Expand Up @@ -569,8 +569,8 @@ func (l *consumerConfigurationListener) Process(event *config_center.ConfigChang
// ServiceDiscoveryRegistryDirectory implementation of Directory:
// Invoker list returned from this Directory's list method have been filtered by Routers
type ServiceDiscoveryRegistryDirectory struct {
base.Directory
RegistryDirectory
*base.Directory
*RegistryDirectory
}

// NewServiceDiscoveryRegistryDirectory will create a new ServiceDiscoveryRegistryDirectory
Expand All @@ -579,7 +579,7 @@ func NewServiceDiscoveryRegistryDirectory(url *common.URL, registry registry.Reg
registryDirectory, _ := dic.(*RegistryDirectory)
return &ServiceDiscoveryRegistryDirectory{
Directory: registryDirectory.Directory,
RegistryDirectory: *registryDirectory,
RegistryDirectory: registryDirectory,
}, err
}

Expand Down

0 comments on commit cbad419

Please sign in to comment.