mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-03-29 07:06:55 +00:00
Fix GET /panic The GET /panic api call is not working due the the logger.Panic method failing to call panic. This change replaces the logger.Panic method call with logger.Info and adds a call to os.Exit(255).
17 lines
302 B
Go
17 lines
302 B
Go
package api
|
|
|
|
import (
|
|
"net/http"
|
|
"os"
|
|
)
|
|
|
|
// Panic godoc
|
|
// @Summary Panic
|
|
// @Description crashes the process with exit code 255
|
|
// @Tags HTTP API
|
|
// @Router /panic [get]
|
|
func (s *Server) panicHandler(w http.ResponseWriter, r *http.Request) {
|
|
s.logger.Info("Panic command received")
|
|
os.Exit(255)
|
|
}
|