You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: backend_config.go
    path of file: ./repos/rudder-server/warehouse/bcm
    
    the code of the file until where you have to start completion: package bcm

import (
	"context"
	"encoding/json"
	"fmt"
	"strings"
	"sync"

	"github.com/rudderlabs/rudder-go-kit/stats"
	"github.com/rudderlabs/rudder-server/utils/misc"

	"github.com/rudderlabs/rudder-server/warehouse/multitenant"

	"github.com/rudderlabs/rudder-server/warehouse/logfield"

	"github.com/samber/lo"

	"github.com/rudderlabs/rudder-go-kit/config"
	"github.com/rudderlabs/rudder-go-kit/logger"
	backendconfig "github.com/rudderlabs/rud
    
func (bcm *BackendConfigManager) Subscribe(ctx context.Context) <-chan []model.Warehouse {
	bcm.subscriptionsMu.Lock()
	defer bcm.subscriptionsMu.Unlock()

	ch := make(chan []model.Warehouse, 10)
	bcm.subscriptions = append(bcm.subscriptions, ch)

	bcm.warehousesMu.Lock()
	if len(bcm.warehouses) > 0 {
		ch <- bcm.warehouses
	}
	bcm.warehousesMu.Unlock()

	go func() {
		<-ctx.Done()

		bcm.subscriptionsMu.Lock()
		defer bcm.subscriptionsMu.Unlock()

		close(ch)

		for i, item := range bcm.subscriptions {
			if item == ch {
				bcm.subscriptions = append(bcm.subscriptions[:i], bcm.subscriptions[i+1:]...)
				return
			}
		}
	}()

	return ch
}