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: server.go
    path of file: ./repos/tracee/pkg/cmd/flags/server
    
    the code of the file until where you have to start completion: package server

import (
	"github.com/aquasecurity/tracee/pkg/errfmt"
	"github.com/aquasecurity/tracee/pkg/logger"
	"github.com/a
    
func PrepareHTTPServer(listenAddr string, metrics, healthz, pprof, pyro bool) (*http.Server, error) {
	if len(listenAddr) == 0 {
		return nil, errfmt.Errorf("http listen address cannot be empty")
	}

	if metrics || healthz || pprof {
		httpServer := http.New(listenAddr)

		if metrics {
			logger.Debugw("Enabling metrics endpoint")
			httpServer.EnableMetricsEndpoint()
		}

		if healthz {
			logger.Debugw("Enabling healthz endpoint")
			httpServer.EnableHealthzEndpoint()
		}

		if pprof {
			logger.Debugw("Enabling pprof endpoint")
			httpServer.EnablePProfEndpoint()
		}
		if pyro {
			logger.Debugw("Enabling pyroscope agent")
			err := httpServer.EnablePyroAgent()
			if err != nil {
				return httpServer, err
			}
		}

		return httpServer, nil
	}

	return nil, nil
}