package checkup import ( "fmt" "net/http" ) func HttpStatusOK(url string, status int) error { resp, err := http.Get(url) if err != nil { return err } defer resp.Body.Close() if resp.StatusCode != status { return fmt.Errorf("Bad status code, expected %d got: %d", status, resp.StatusCode) } return nil }