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: detect.go
    path of file: ./repos/netbird/client/system/detect_platform
    
    the code of the file until where you have to start completion: package detect_platform

import (
	"context"
	"net/http"
	"sync"
	"time"
)

var hc = &http.Client{Timeout: 300 * time.Millisecond}

func Detect(ctx context.Context) string {
	subCt
    
func Detect(ctx context.Context) string {
	subCtx, cancel := context.WithCancel(context.Background())
	defer cancel()

	funcs := []func(context.Context) string{
		detectOpenStack,
		detectContainer,
	}

	results := make(chan string, len(funcs))

	var wg sync.WaitGroup

	for _, fn := range funcs {
		wg.Add(1)
		go func(f func(context.Context) string) {
			defer wg.Done()
			select {
			case <-subCtx.Done():
				return
			default:
				if result := f(ctx); result != "" {
					results <- result
					cancel()
				}
			}
		}(fn)
	}

	go func() {
		wg.Wait()
		close(results)
	}()

	for result := range results {
		if result != "" {
			return result
		}
	}

	return ""
}