We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 624d62d commit ed4ee93Copy full SHA for ed4ee93
1 file changed
alertlogger.go
@@ -96,14 +96,13 @@ func printKV(ag *alertGroup, m *sync.Mutex) {
96
func main() {
97
var m sync.Mutex
98
99
- jsonOutput := false
100
- if os.Getenv("JSON_OUTPUT") == "true" {
101
- jsonOutput = true
102
- }
+ jsonOutput := os.Getenv("JSON_OUTPUT") == "true"
+
+ http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
+ defer func() {
103
+ _ = r.Body.Close()
104
+ }()
105
- http.HandleFunc("/",func(w http.ResponseWriter, r *http.Request) {
- defer r.Body.Close()
106
-
107
b, err := io.ReadAll(r.Body)
108
if err != nil {
109
panic(err)
0 commit comments