mirror of
https://github.com/adnanh/webhook.git
synced 2025-08-03 16:30:29 +00:00
update error checking of uuid generate
This commit is contained in:
parent
0aa7395e21
commit
5b4e9ac00b
1 changed files with 7 additions and 1 deletions
|
@ -202,7 +202,13 @@ func main() {
|
||||||
func hookHandler(w http.ResponseWriter, r *http.Request) {
|
func hookHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
// generate a request id for logging
|
// generate a request id for logging
|
||||||
rid := uuid.NewV4().String()[:6]
|
uuid, err := uuid.NewV4()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("[%s] error generating uuid %s\n", uuid, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
rid := uuid.String()[:6]
|
||||||
|
|
||||||
log.Printf("[%s] incoming HTTP request from %s\n", rid, r.RemoteAddr)
|
log.Printf("[%s] incoming HTTP request from %s\n", rid, r.RemoteAddr)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue