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: healthcheck.go
    path of file: ./repos/vouch-proxy/pkg/healthcheck
    
    the code of the file until where you have to start completion: /*

Copyright 2020 The Vouch Proxy Authors.
Use of this source code is governed by The MIT License (MIT) that
can be found in the LICENSE file. Software distributed under The
MIT License is distributed on an "AS
    
func healthcheck() {
	url := fmt.Sprintf("http://%s:%d/healthcheck", cfg.Cfg.Listen, cfg.Cfg.Port)
	log.Debugf("Invoking healthcheck on %s", url)
	// #nosec - turn off gosec checking which flags `http.Get(url)`
	resp, err := http.Get(url)
	if err == nil {
		body, err := ioutil.ReadAll(resp.Body)
		resp.Body.Close()
		if err == nil {
			var result map[string]interface{}
			jsonErr := json.Unmarshal(body, &result)
			if jsonErr == nil {
				if result["ok"] == true {
					log.Debugf("Healthcheck succeeded for %s", url)
					os.Exit(0)
				}
			}
		}
	}
	log.Errorf("Healthcheck failed for %s", url)
	os.Exit(1)
}