mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 16:15:42 -06:00
Fix gosec finding of unhandled errors (#29398)
Not critical but fixing it to avoid gosec reporting G104.
This commit is contained in:
parent
5739764e06
commit
96eefee402
@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@ -15,10 +16,12 @@ func hello(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
line := fmt.Sprintf("webbhook: -> %s", string(body))
|
||||
fmt.Println(line)
|
||||
io.WriteString(w, line)
|
||||
if _, err := io.WriteString(w, line); err != nil {
|
||||
log.Printf("Failed to write: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/", hello)
|
||||
http.ListenAndServe(":3010", nil)
|
||||
log.Fatal(http.ListenAndServe(":3010", nil))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user