Skip to content
Snippets Groups Projects
Commit 9e592847 authored by 邹毅贤's avatar 邹毅贤
Browse files

fix review comments

parent 330e22da
No related branches found
No related tags found
No related merge requests found
......@@ -116,11 +116,13 @@ func getRandomPort(protocolConfigs []*ProtocolConfig) *list.List {
}
tcp, err := gxnet.ListenOnTCPRandomPort(proto.Ip)
if tcp != nil {
defer tcp.Close()
}
if err != nil {
panic(perrors.New(fmt.Sprintf("Get tcp port error,err is {%v}", err)))
}
ports.PushBack(strings.Split(tcp.Addr().String(), ":")[1])
defer tcp.Close()
}
return ports
}
......@@ -143,8 +145,7 @@ func (c *ServiceConfig) Export() error {
regUrls := loadRegistries(c.Registry, providerConfig.Registries, common.PROVIDER)
urlMap := c.getUrlMap()
protocolConfigs := loadProtocol(c.Protocol, providerConfig.Protocols)
protocolSize := len(protocolConfigs)
if protocolSize == 0 {
if len(protocolConfigs) == 0 {
logger.Warnf("The service %v's '%v' protocols don't has right protocolConfigs ", c.InterfaceName, c.Protocol)
return nil
}
......
......@@ -22,11 +22,14 @@ import (
)
import (
"github.com/apache/dubbo-go/common/extension"
gxnet "github.com/dubbogo/gost/net"
"github.com/stretchr/testify/assert"
)
import (
"github.com/apache/dubbo-go/common/extension"
)
func doInitProvider() {
providerConfig = &ProviderConfig{
ApplicationConfig: &ApplicationConfig{
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment