pager.go
func post(reqBody []byte) (respBody map[string]string, err error) {
	resp, err := http.Post(endpoint, "application/json", bytes.NewReader(reqBody))
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()

	bodyBytes, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return nil, err
	}

	if resp.StatusCode != http.StatusOK {
		return nil, fmt.Errorf("%s: %s", resp.Status, string(bodyBytes))
	}

	respBody = map[string]string{}
	err = json.Unmarshal(bodyBytes, &respBody)
	return respBody, err
}
func post(reqBody []byte) (respBody map[string]string, err error) {
	resp, err := http.Post(endpoint, "application/json", bytes.NewReader(reqBody))
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()

	bodyBytes, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return nil, err
	}

	if resp.StatusCode != http.StatusOK {
		return nil, fmt.Errorf("%s: %s", resp.Status, string(bodyBytes))
	}

	respBody = map[string]string{}
	err = json.Unmarshal(bodyBytes, &respBody)
	return respBody, err
}
// -- Utils
// post sends a POST request with the given request body to PagerDuty. See this
// URL for details about PagerDuty API response codes, etc:
// https://developer.pagerduty.com/documentation/integration/events