func (subChMap *subChannelMap) registerNewSubChannel(serviceName string, ch *Channel) (_ *SubChannel, added bool) {
	subChMap.Lock()
	defer subChMap.Unlock()

	if subChMap.subchannels == nil {
		subChMap.subchannels = make(map[string]*SubChannel)
	}

	if sc, ok := subChMap.subchannels[serviceName]; ok {
		return sc, false
	}

	sc := newSubChannel(serviceName, ch)
	subChMap.subchannels[serviceName] = sc
	return sc, true
}
func (subChMap *subChannelMap) registerNewSubChannel(serviceName string, ch *Channel) (_ *SubChannel, added bool) {
	subChMap.Lock()
	defer subChMap.Unlock()

	if subChMap.subchannels == nil {
		subChMap.subchannels = make(map[string]*SubChannel)
	}

	if sc, ok := subChMap.subchannels[serviceName]; ok {
		return sc, false
	}

	sc := newSubChannel(serviceName, ch)
	subChMap.subchannels[serviceName] = sc
	return sc, true
}
func ( subChMap * subChannelMap ) registerNewSubChannel ( serviceName string , ch * Channel ) ( _ * SubChannel , added bool ) { subChMap . Lock ( ) defer subChMap . Unlock ( ) if subChMap . subchannels == nil { subChMap . subchannels = make ( map [ string ] * SubChannel ) } if sc , ok := subChMap . subchannels [ serviceName ] ; ok { return sc , false } sc := newSubChannel ( serviceName , ch ) subChMap . subchannels [ serviceName ] = sc return sc , true }
// Register a new subchannel for the given serviceName
Register a new subchannel for the given serviceName