Commit 2a43c0fd authored by Aksel Baardsen's avatar Aksel Baardsen
Browse files

Added comments

parent 02913859
......@@ -27,6 +27,6 @@ func Chandler(w http.ResponseWriter, r *http.Request) {
}
} else {
// need to check error for content when setting header (pkg.CorrectHeader)
http.Error(w, "An error occured", pkg.CorrectHeader(err))
http.Error(w, "An error occurred", pkg.CorrectHeader(err))
}
}
......@@ -11,7 +11,7 @@ func Dhandler(w http.ResponseWriter, r *http.Request) {
var diagnostics pkg.Diag
if err := pkg.GetDiag(&diagnostics); err != nil {
http.Error(w, "An error occured", http.StatusBadGateway)
http.Error(w, "An error occurred", http.StatusBadGateway)
}
w.Header().Set("Content-Type", "application/json")
......
......@@ -21,6 +21,6 @@ func Shandler(w http.ResponseWriter, r *http.Request) {
}
} else {
w.WriteHeader(pkg.CorrectHeader(err))
_, _ = fmt.Fprintln(w, "An error occured")
_, _ = fmt.Fprintln(w, "An error occurred")
}
}
......@@ -36,6 +36,7 @@ func GetDiag(d* Diag) error {
return nil
}
// Gets GBIF-api status code
func getGbifStatus(d *Diag) error {
resp, err := http.Get(gbifApi)
if err != nil {
......@@ -45,6 +46,7 @@ func getGbifStatus(d *Diag) error {
return nil
}
// Gets country-api status code
func getRestStatus(d *Diag) error {
resp, err := http.Get(restApi)
if err != nil {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment