in worker.go [33:46]
func (i *input) HTTP() output {
return i.benchmark(func() error {
req, _ := http.NewRequest("GET", i.endpoint+"/api/ping", nil)
req.Header.Add("User-Agent", "GCPing-CLI")
res, err := client.Do(req)
if err != nil {
return err
}
if res.StatusCode != http.StatusOK {
return fmt.Errorf("status code: %v", res.StatusCode)
}
return nil
})
}