Skip to content

Commit ed4ee93

Browse files
committed
linter fixes
1 parent 624d62d commit ed4ee93

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

alertlogger.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,13 @@ func printKV(ag *alertGroup, m *sync.Mutex) {
9696
func main() {
9797
var m sync.Mutex
9898

99-
jsonOutput := false
100-
if os.Getenv("JSON_OUTPUT") == "true" {
101-
jsonOutput = true
102-
}
99+
jsonOutput := os.Getenv("JSON_OUTPUT") == "true"
100+
101+
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
102+
defer func() {
103+
_ = r.Body.Close()
104+
}()
103105

104-
http.HandleFunc("/",func(w http.ResponseWriter, r *http.Request) {
105-
defer r.Body.Close()
106-
107106
b, err := io.ReadAll(r.Body)
108107
if err != nil {
109108
panic(err)

0 commit comments

Comments
 (0)