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: main.go
    path of file: ./repos/linkerd2/web
    
    the code of the file until where you have to start completion: package main

import (
	"context"
	"flag"
	"net"
	"os"
	"os/signal"
	"regexp"
	"syscall"
	"time"

	"github.com/linkerd/linkerd2/pkg/config"

	"github.com/linkerd/linkerd2/pkg/admin"
	"github.com/linkerd/linkerd2/pkg/charts/linkerd2"
	"github.com/linkerd/linkerd2/pkg/flags"
	"github.com/linkerd/linkerd2/pkg/healthcheck"
	"github.com/linkerd/linkerd2/pkg/k8s"
	"github.com/linkerd/linkerd2/pkg/trace"
	"github.com/linkerd/linkerd2/viz/metrics-api/client"
	"github.com/linkerd/linkerd2/web/srv"
	log "github.com/sirupsen/logrus"
)

func main() {
	cmd := flag.NewFlagSet("public-api", flag.ExitOnError)

	addr := cmd.String("addr", ":8084", "address to serve on")
	metricsAddr := cmd.String("metrics-addr", ":9994", "address to serve scrapable metrics on")
	vizAPIAddr := cmd.String("linkerd-metrics-api-addr", "127.0.0.1:8085", "address of the linkerd-metrics-api service")
	grafanaAddr := cmd.String("grafana-addr", "", "address of the linkerd-grafana service")
	grafanaExternalAddr := cmd.String("grafana-external-addr", "", "address of the external grafana service")
	grafanaPrefix := cmd.String("grafana-prefix", "", "prefix for Grafana dashboard UID's")
	jaegerAddr := cmd.String("jaeger-addr", "", "address of the jaeger service")
	templateDir := cmd.String("template-dir", "templates", "directory to search for template files")
	staticDir := cmd.String("static-dir", "app/dist", "directory to search for static files")
	reload := cmd.Bool("reload", true, "reloading set to true or false")
	controllerNamespace := cmd.String("controller-namespace", "linkerd", "namespace in which Linkerd is installed")
	enforcedHost := cmd.String("enforced-host", "", "regexp describing the allowed values for the Host header; protects from DNS-rebinding attacks")
	kubeConfigPath := cmd.String("kubeconfig", "", "path to kube config")
	clusterDomain := cmd.String("cluster-domain", "", "kubernetes cluster domain")
	enablePprof := cmd.Bool("enable-pprof", false, "Enable pprof endpoints on the admin server")

	traceCollector := flags.AddTraceFlags(cmd)

	flags.ConfigureAndParse(cmd, os.Args[1:])

	ready := false
	adminServer := admin.NewServer(*metricsAddr, *enablePprof, &ready)

	go func() {
		log.Infof("starting admin server on %s", *metricsAddr)
		if err := adminServer.ListenAndServe(); err != nil {
			log.Errorf("failed to start web admin server: %s", err)
		}
	}()

	ctx := context.Background()

	_, _, err := net.SplitHostPort(*vizAPIAddr) // Verify vizAPIAddr is of the form host:port.
	if err != nil {
		log.Fatalf("failed to parse metrics API server address: %s", *vizAPIAddr)
	}
	client, err := client.NewInternalClient(*vizAPIAddr)
	if err != nil {
		log.Fatalf("failed to construct client for viz API server URL %s", *vizAPIAddr)
	}

	if *clusterDomain == "" {
		*clusterDomain = "cluster.local"
		log.Warnf("expected cluster domain through args (falling back to %s)", *clusterDomain)
	}

	k8sAPI, err := k8s.NewAPI(*kubeConfigPath, "", "", []string{}, 0)
	if err != nil {
		log.Fatalf("failed to construct Kubernetes API client: [%s]", err)
	}

	// Setup health checker
	checks := []healthcheck.CategoryID{
		healthcheck.KubernetesAPIChecks,
		healthcheck.KubernetesVersionChecks,
		healthcheck.LinkerdConfigChecks,
		healthcheck.LinkerdControlPlaneExistenceChecks,
		healthcheck.LinkerdVersionChecks,
		healthcheck.LinkerdControlPlaneVersionChecks,
	}
	hc := healthcheck.NewHealthChecker(checks, &healthcheck.Options{
		ControlPlaneNamespace: *controllerNamespace,
		KubeConfig:            *kubeConfigPath,
	})

	uuid, version := getUUIDAndVersion(ctx, k8sAPI, *controllerNamespace)

	stop := make(chan os.Signal, 1)
	signal.Notify(stop, os.Interrupt, syscall.SIGTERM)

	if *traceCollector != "" {
		if err := trace.InitializeTracing("web", *traceCollector); err != nil {
			log.Warnf("failed to initialize tracing: %s", err)
		}
	}

	reHost, err := 
    
func main() {
	cmd := flag.NewFlagSet("public-api", flag.ExitOnError)

	addr := cmd.String("addr", ":8084", "address to serve on")
	metricsAddr := cmd.String("metrics-addr", ":9994", "address to serve scrapable metrics on")
	vizAPIAddr := cmd.String("linkerd-metrics-api-addr", "127.0.0.1:8085", "address of the linkerd-metrics-api service")
	grafanaAddr := cmd.String("grafana-addr", "", "address of the linkerd-grafana service")
	grafanaExternalAddr := cmd.String("grafana-external-addr", "", "address of the external grafana service")
	grafanaPrefix := cmd.String("grafana-prefix", "", "prefix for Grafana dashboard UID's")
	jaegerAddr := cmd.String("jaeger-addr", "", "address of the jaeger service")
	templateDir := cmd.String("template-dir", "templates", "directory to search for template files")
	staticDir := cmd.String("static-dir", "app/dist", "directory to search for static files")
	reload := cmd.Bool("reload", true, "reloading set to true or false")
	controllerNamespace := cmd.String("controller-namespace", "linkerd", "namespace in which Linkerd is installed")
	enforcedHost := cmd.String("enforced-host", "", "regexp describing the allowed values for the Host header; protects from DNS-rebinding attacks")
	kubeConfigPath := cmd.String("kubeconfig", "", "path to kube config")
	clusterDomain := cmd.String("cluster-domain", "", "kubernetes cluster domain")
	enablePprof := cmd.Bool("enable-pprof", false, "Enable pprof endpoints on the admin server")

	traceCollector := flags.AddTraceFlags(cmd)

	flags.ConfigureAndParse(cmd, os.Args[1:])

	ready := false
	adminServer := admin.NewServer(*metricsAddr, *enablePprof, &ready)

	go func() {
		log.Infof("starting admin server on %s", *metricsAddr)
		if err := adminServer.ListenAndServe(); err != nil {
			log.Errorf("failed to start web admin server: %s", err)
		}
	}()

	ctx := context.Background()

	_, _, err := net.SplitHostPort(*vizAPIAddr) // Verify vizAPIAddr is of the form host:port.
	if err != nil {
		log.Fatalf("failed to parse metrics API server address: %s", *vizAPIAddr)
	}
	client, err := client.NewInternalClient(*vizAPIAddr)
	if err != nil {
		log.Fatalf("failed to construct client for viz API server URL %s", *vizAPIAddr)
	}

	if *clusterDomain == "" {
		*clusterDomain = "cluster.local"
		log.Warnf("expected cluster domain through args (falling back to %s)", *clusterDomain)
	}

	k8sAPI, err := k8s.NewAPI(*kubeConfigPath, "", "", []string{}, 0)
	if err != nil {
		log.Fatalf("failed to construct Kubernetes API client: [%s]", err)
	}

	// Setup health checker
	checks := []healthcheck.CategoryID{
		healthcheck.KubernetesAPIChecks,
		healthcheck.KubernetesVersionChecks,
		healthcheck.LinkerdConfigChecks,
		healthcheck.LinkerdControlPlaneExistenceChecks,
		healthcheck.LinkerdVersionChecks,
		healthcheck.LinkerdControlPlaneVersionChecks,
	}
	hc := healthcheck.NewHealthChecker(checks, &healthcheck.Options{
		ControlPlaneNamespace: *controllerNamespace,
		KubeConfig:            *kubeConfigPath,
	})

	uuid, version := getUUIDAndVersion(ctx, k8sAPI, *controllerNamespace)

	stop := make(chan os.Signal, 1)
	signal.Notify(stop, os.Interrupt, syscall.SIGTERM)

	if *traceCollector != "" {
		if err := trace.InitializeTracing("web", *traceCollector); err != nil {
			log.Warnf("failed to initialize tracing: %s", err)
		}
	}

	reHost, err := regexp.Compile(*enforcedHost)
	if err != nil {
		log.Fatalf("invalid --enforced-host parameter: %s", err)
	}

	server := srv.NewServer(*addr, *grafanaAddr, *grafanaExternalAddr, *grafanaPrefix, *jaegerAddr, *templateDir, *staticDir, uuid, version,
		*controllerNamespace, *clusterDomain, *reload, reHost, client, k8sAPI, hc)

	go func() {
		log.Infof("starting HTTP server on %+v", *addr)
		if err := server.ListenAndServe(); err != nil {
			log.Errorf("failed to start web HTTP server: %s", err)
		}
	}()

	ready = true

	<-stop

	log.Infof("shutting down HTTP server on %+v", *addr)
	ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
	defer cancel()
	server.Shutdown(ctx)
	adminServer.Shutdown(ctx)
}