mirror of
https://github.com/adnanh/webhook.git
synced 2026-07-26 08:39:17 +08:00
Use gofrs/uuid instead of satori/go.uuid
The satori package appears to be unmaintained. The gofrs package is a fork that is actively maintained by a larger group of Go developers.
This commit is contained in:
+10
-4
@@ -16,11 +16,9 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/adnanh/webhook/hook"
|
||||
|
||||
"github.com/codegangsta/negroni"
|
||||
"github.com/gofrs/uuid"
|
||||
"github.com/gorilla/mux"
|
||||
uuid "github.com/satori/go.uuid"
|
||||
|
||||
fsnotify "gopkg.in/fsnotify.v1"
|
||||
)
|
||||
|
||||
@@ -229,7 +227,15 @@ func main() {
|
||||
|
||||
func hookHandler(w http.ResponseWriter, r *http.Request) {
|
||||
// generate a request id for logging
|
||||
rid := uuid.NewV4().String()[:6]
|
||||
u, err := uuid.NewV4()
|
||||
if err != nil {
|
||||
log.Printf("internal server error: %s", err)
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
fmt.Fprint(w, "Internal server error")
|
||||
return
|
||||
}
|
||||
|
||||
rid := u.String()[:6]
|
||||
|
||||
log.Printf("[%s] incoming HTTP request from %s\n", rid, r.RemoteAddr)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user