mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -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"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -15,10 +16,12 @@ func hello(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
line := fmt.Sprintf("webbhook: -> %s", string(body))
|
line := fmt.Sprintf("webbhook: -> %s", string(body))
|
||||||
fmt.Println(line)
|
fmt.Println(line)
|
||||||
io.WriteString(w, line)
|
if _, err := io.WriteString(w, line); err != nil {
|
||||||
|
log.Printf("Failed to write: %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
http.HandleFunc("/", hello)
|
http.HandleFunc("/", hello)
|
||||||
http.ListenAndServe(":3010", nil)
|
log.Fatal(http.ListenAndServe(":3010", nil))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user