diff --git a/config/service_config.go b/config/service_config.go index f45e78cd63755170ead0b54a1d9b559e87e1ab11..4dbd5843980a73fcb33526fe6ebd063d9c7b6a22 100644 --- a/config/service_config.go +++ b/config/service_config.go @@ -109,7 +109,7 @@ func NewServiceConfig(id string, context context.Context) *ServiceConfig { // Get Random Port func getRandomPort(protocolConfigs []*ProtocolConfig) *list.List { - l := list.New() + ports := list.New() for _, proto := range protocolConfigs { if len(proto.Port) > 0 { continue @@ -119,10 +119,10 @@ func getRandomPort(protocolConfigs []*ProtocolConfig) *list.List { if err != nil { panic(perrors.New(fmt.Sprintf("Get tcp port error,err is {%v}", err))) } - l.PushBack(strings.Split(tcp.Addr().String(), ":")[1]) + ports.PushBack(strings.Split(tcp.Addr().String(), ":")[1]) defer tcp.Close() } - return l + return ports } // Export ...