()
| 548 | } |
| 549 | |
| 550 | func (t *App) buildinfoHandler() http.HandlerFunc { |
| 551 | return func(w http.ResponseWriter, r *http.Request) { |
| 552 | w.Header().Set("Content-Type", "application/json") |
| 553 | err := json.NewEncoder(w).Encode(build.GetVersion()) |
| 554 | |
| 555 | if err != nil { |
| 556 | http.Error(w, err.Error(), http.StatusInternalServerError) |
| 557 | level.Error(log.Logger).Log("msg", "error writing response", "err", err) |
| 558 | } else { |
| 559 | w.WriteHeader(http.StatusOK) |
| 560 | } |
| 561 | } |
| 562 | } |
no test coverage detected